#33 Get rid of ntohl usage, simplify bitreader/bitwrite coder

closed-out-of-date
nobody
None
5
2012-12-12
2009-03-09
Max Horn
No

The following patch is made against CVS HEAD, and simplifies the code flow on little endian systems in src/libFLAC/bitreader.c and src/libFLAC/bitwriter.c.

This has the following effects:
* The code is shorter and easier to read
* No dependency on winsock just for a trivial function (ntohl) on Windows
* Should actually be faster on systems with ntohl, since the compiler cannot optimize ntohl if it is a lib function, and even in GCC it is not an intrinsic, so it never made sense to use it in the first place
* It will automatically work on any other little endian system, as long as configure is working correctly.

Discussion

  • Max Horn
    Max Horn
    2009-03-09

    2nd rev of the patch, gets rid of MINGW_WINSOCK_LIBS

     
  • Max Horn
    Max Horn
    2009-03-09

    Oops, forgot to remove the winsock refs in configure and various Makefile.am -- just updated a revised patch including this, too.

     
  • Max Horn
    Max Horn
    2012-12-12

    • status: open --> closed-out-of-date
     
  • Max Horn
    Max Horn
    2012-12-12

    Turns out this has already been fixed in the "new" flac repository, great :-). Sad: This new repos is quite obscure and hard to find... :-( here it is, for reference: https://git.xiph.org/?p=flac.git