
El 30/05/12 14:23, dieter escribió:
ifndef _GNU_SOURCE #define _GNU_SOURCE #endif
#include <stdint.h> #include <cstdio>
static const int marker[] = { 0xAC, 0xDC, 0xAC, 0xDC };
inline static uint8_t *findMarker_bin(uint8_t * curFilePos, const uint8_t * const fileEnd) { for (;;) { if ((*curFilePos == marker[0]) && (*(curFilePos + 1) == marker[1]) && (*(curFilePos + 2) == marker[2]) && (*(curFilePos + 3) == marker[3])) { return curFilePos + 4; } else { curFilePos++; if (curFilePos >= fileEnd - 3) { printf("end of mapped file reached!\n"); return 0; } } } }
int main(int argc, char **argv) { uint8_t *curPos=NULL, *endPos=NULL; curPos = findMarker_bin(curPos, endPos); return 0; }
Your test case does not produce an ICE here... -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org