If you are talking about bit representation for negative numbers having a leading 1, then you could use:
int intValue = -127;
long longValue;
if((0x80 << (sizeof(int)-1)) & intValue)
{
longValue = (0x80 << ((sizeof(long)-1)*8)) | ((0x80 << ((sizeof(int)-1)*8)) ^ intValue);
}else{
longValue = intValue
}
I hope I did not mess up with the brackets.