snap-stanford/snap — pull request #25 by statX (2013-08-05 21:33:02+00:00)
Title: changed functional casts to c-list casts. Needed to compile on GCC 4.8.1...

changed functional casts to c-list casts for two lines in glib-core/unicode.h
This is needed to compile with GCC 4.8.1 on OSX 10.8 and Fedora 19.
The latest Intel compiler works in both cases with messages about ignoring packing.

Prior to the change snap would not compile with GCC 4.8.1 on OSX 10.8 or Fedora 19 with error message below. Changing the casts in the two lines in unicode.h resulted in compilation using GCC 4.8.1 on both platforms.

[alanw@localhost snap]$ make all
make -C snap-core
make[1]: Entering directory `/home/alanw/temp1/snap/snap-core'
g++ -c -std=c++98 -Wall -O3 Snap.cpp -I../glib-core
In file included from ../glib-core/base.h:154:0,
from Snap.h:8,
from Snap.cpp:4:
../glib-core/unicode.h: In static member function ‘static ushort TUniChInfo::GetLineBreakCode(char, char)’:
../glib-core/unicode.h:1031:87: error: invalid qualifiers on non-member function type
static inline ushort GetLineBreakCode(char c1, char c2) { return ((ushort(uchar(c1)) & 0xff) << 8) | ((ushort(uchar(c2)) & 0xff)); }
^
../glib-core/unicode.h:1031:87: error: invalid qualifiers on non-member function type
../glib-core/unicode.h:1031:123: error: invalid qualifiers on non-member function type
static inline ushort GetLineBreakCode(char c1, char c2) { return ((ushort(uchar(c1)) & 0xff) << 8) | ((ushort(uchar(c2)) & 0xff)); }
^
../glib-core/unicode.h:1031:123: error: invalid qualifiers on non-member function type
../glib-core/unicode.h: In member function ‘void TUniChInfo::InitAfterLoad()’:
../glib-core/unicode.h:1037:53: error: invalid qualifiers on non-member function type
subCat = (TUniChSubCategory) (((int(uchar(chCat)) & 0xff) << 8) | (int(uchar(chSubCat)) & 0xff)); }
^
../glib-core/unicode.h:1037:53: error: invalid qualifiers on non-member function type
../glib-core/unicode.h:1037:91: error: invalid qualifiers on non-member function type
subCat = (TUniChSubCategory) (((int(uchar(chCat)) & 0xff) << 8) | (int(uchar(chSubCat)) & 0xff)); }
^
../glib-core/unicode.h:1037:91: error: invalid qualifiers on non-member function type
dmake[1]: *** [Snap.o] Error 1
make[1]: Leaving directory `/home/alanw/temp1/snap/snap-core'
make: *** [MakeAll] Error 2