From: Peter K. <ka...@us...> - 2005-07-18 13:58:31
|
Update of /cvsroot/swishe/swish-e/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7280 Modified Files: docprop.c Log Message: patch from Sorithy Seng to fix sparc64 issue (64-bit issue?) Index: docprop.c =================================================================== RCS file: /cvsroot/swishe/swish-e/src/docprop.c,v retrieving revision 1.124 retrieving revision 1.125 diff -u -r1.124 -r1.125 --- docprop.c 12 May 2005 15:41:05 -0000 1.124 +++ docprop.c 18 Jul 2005 13:58:23 -0000 1.125 @@ -177,7 +177,20 @@ #include <zlib.h> #endif - +/******************************************************************* +* Convert a propValue to a unsigned long +* +********************************************************************/ +union _conv_ { + char c[sizeof(unsigned long)]; + unsigned long l; +}; +unsigned long convPropValue2ULong(char *propValue) +{ + union _conv_ u; + memcpy(u.c, propValue, sizeof(unsigned long)); + return u.l; +} /******************************************************************* @@ -276,7 +289,8 @@ if ( is_meta_date(meta_entry) ) { s=emalloc(30); - i = *(unsigned long *) prop->propValue; /* read binary */ + /* i = *(unsigned long *) prop->propValue; */ /* read binary */ + i = convPropValue2ULong(prop->propValue); /* read binary */ i = UNPACKLONG(i); /* Convert the portable number */ strftime(s,30, DATE_FORMAT_STRING, (struct tm *)localtime((time_t *)&i)); return s; @@ -287,7 +301,8 @@ if ( is_meta_number(meta_entry) ) { s=emalloc(14); - i=*(unsigned long *)prop->propValue; /* read binary */ + /* i=*(unsigned long *)prop->propValue; */ /* read binary */ + i = convPropValue2ULong(prop->propValue); /* read binary */ i = UNPACKLONG(i); /* Convert the portable number */ sprintf(s,"%lu",i); return s; @@ -641,7 +656,8 @@ if ( is_meta_number(meta_entry) ) { unsigned long i; - i = *(unsigned long *) prop->propValue; /* read binary */ + /* i = *(unsigned long *) prop->propValue;*/ /* read binary */ + i = convPropValue2ULong(prop->propValue); /* read binary */ i = UNPACKLONG(i); /* Convert the portable number */ pv->datatype = PROP_ULONG; pv->value.v_ulong = i; @@ -653,7 +669,8 @@ if ( is_meta_date(meta_entry) ) { unsigned long i; - i = *(unsigned long *) prop->propValue; /* read binary */ + /* i = *(unsigned long *) prop->propValue; */ /* read binary */ + i = convPropValue2ULong(prop->propValue); /* read binary */ i = UNPACKLONG(i); /* Convert the portable number */ pv->datatype = PROP_DATE; pv->value.v_date = (time_t)i; |