jmfriedt/sentinel1_level0

Using stdint.h types and standard C file functions

Opened this issue · 1 comments

Suggestions so your wonderful utility also works on Windows/Visual Studio compiler:

  • Use standard C file functions fopen()/fclose()/fread() instead POSIX open()/close()/read().
  • Update to use stdint.h uint16_t/uint32_t instead of u_int16_t/u_int32_t
  • If windows compiler #if defined(MSC_VER) then include winsock2.h; otherwise, include arpa/inet.h and unistd.h.

Suggestion to avoid stack overflow:

  • For large arrays (e.g., "hcodeIE/hcodeIO/hcodeQE/hcodeQO/BRCn/THIDXn" in packet_decode.c and "tablo" in read_file.c) put them in global (.data/.bss) section instead of allocating on stack, e.g., :
    (suggested update)
    static unsigned char tablo[65536];
    vs. (original)
    unsigned char tablo[65536];

Thanks!

I am glad you are enjoying this tool. I do not have access to a proprietary operating system or compiler to check if the updates are functional, but please let me know if commit 956d94e matches your expectations. At least with GNU/Linux I do not see a change in behavior.
Thanks.