Search the web
Sign In
New User? Sign Up
ClearSilver
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Build problem on amd64 (cs/test_crc.cs failes) - patch included   Message List  
Reply | Forward Message #1177 of 1347 |
Hello,

the code in cs/ does not pass it's testsuite on amd64 machines, at least not
on mine and a quick search on the net confirmed that others have the problem
too.

The crc32 result is assigned to a long field and therfore does not "wrap
around" (get negative).

I was able to solve this issue by explicitly casting the ne_crc()-result to
INT32 (as typedef'ed in neo_misc.h) when assigned to result->n (a long
field).

The code compiles and runs just fine and passes the testsuite.

The simple patch:
---------------------%<--------------------
*** cs/csparse.c.orig 2007-07-12 04:37:34.000000000 +0200
--- cs/csparse.c 2008-04-30 20:39:42.000000000 +0200
***************
*** 3717,3723 ****
if (val.op_type & (CS_TYPE_VAR | CS_TYPE_STRING))
{
char *s = arg_eval(parse, &val);
! if (s) result->n = ne_crc((unsigned char *)s, strlen(s));
}
if (val.alloc) free(val.s);
return STATUS_OK;
--- 3717,3723 ----
if (val.op_type & (CS_TYPE_VAR | CS_TYPE_STRING))
{
char *s = arg_eval(parse, &val);
! if (s) result->n = (INT32) ne_crc((unsigned char *)s, strlen(s));
}
if (val.alloc) free(val.s);
return STATUS_OK;
---------------------%<--------------------

If there is a problem with this I don't see, please comment so that I can
search for another solution.

kind regards,
Tom Regner



Wed Apr 30, 2008 7:02 pm

clearsilver@...
Send Email Send Email

Forward
Message #1177 of 1347 |
Expand Messages Author Sort by Date

Hello, the code in cs/ does not pass it's testsuite on amd64 machines, at least not on mine and a quick search on the net confirmed that others have the...
Thomas Regner
clearsilver@...
Send Email
Apr 30, 2008
8:42 pm

... Yeah, that seems like a fine result. I've known about the issue, but didn't have a good idea of the "right" solution... the crc result would be different,...
Brandon Long
blong42
Offline Send Email
Apr 30, 2008
8:50 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help