chrisdunelm / DotNetAnywhere

Small .NET interpreter
MIT License
549 stars 77 forks source link

Porting issues #1

Closed amerkoleci closed 11 years ago

amerkoleci commented 11 years ago

Hi, First of all, congrats on your so tiny but nice looking .NET framework. I'm trying to integrate it into my project and make it run on Android using the Android NDK. When i compile with VS 2012 or android NDK, i'm getting those issues and hopefully you can help me out.

Heap.c

// Use pSync to point to next entry in this linked-list. (tHeapEntry*)(pNode->pSync) = pToDelete; <!----- Temporary lvalue assign --> pToDelete = pNode;

MetaData.c in MetaData_DecodeSigEntry

unsigned int MetaData_DecodeSigEntry(SIG pSig) { unsigned char a,b,c,d; a = *((unsigned char)*pSig)++; if ((a & 0x80) == 0) { // 1-byte entry return a; } // Special case if (a == 0xff) { return 0; }

b = *((unsigned char*)*pSig)++; <!--- error: lvalue required as incremental operand -->
if ((a & 0xc0) == 0x80) {
    // 2-byte entry
    return ((int)(a & 0x3f)) << 8 | b;
}
// 4-byte entry
c = *((unsigned char*)*pSig)++; <!--- error: lvalue required as incremental operand -->
d = *((unsigned char*)*pSig)++; <!--- error: lvalue required as incremental operand -->
return ((int)(a & 0x1f)) << 24 | ((int)b) << 16 | ((int)c) << 8 | d;

}

Could you help me out here?

Thanks,

Amer Koleci

amerkoleci commented 11 years ago

Here are the solution: Heap.c (tHeapEntry*)&(pNode->pSync) = pToDelete;

MetaData_DecodeSigEntry need to be replaced with:

a = _(_pSig)++;