mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-30 08:34:16 +01:00
clear high-bit when generating gameIDs
postgres DB, at least on ARM, doesn't like it.
This commit is contained in:
parent
d3440dc7d6
commit
0ea9b42db8
1 changed files with 3 additions and 0 deletions
|
@ -84,6 +84,9 @@ makeGameID( XW_UtilCtxt* util )
|
|||
while ( 0 == gameID ) {
|
||||
/* High bit never set by XP_RANDOM() alone */
|
||||
gameID = (XP_RANDOM() << 16) ^ XP_RANDOM();
|
||||
/* But let's clear it -- set high-bit causes problems for existing
|
||||
postgres DB where INTEGER is apparently a signed 32-bit */
|
||||
gameID &= 0x7FFFFFFF;
|
||||
}
|
||||
LOG_RETURNF( "%x/%d", gameID, gameID );
|
||||
return gameID;
|
||||
|
|
Loading…
Add table
Reference in a new issue