Custom Query (541 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (46 - 48 of 541)

Ticket Resolution Summary Owner Reporter
#266 fixed storemac() makes invalid calls to storeword() somebody baker
Description

For svn version 5454, storemac() in src/libsrc/lib330/libcvrt.c gives compiler warnings:

/usr/bin/gcc -m32 -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I/opt/earthworm/earthworm-7.6-5454/include -g -m32 -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I/opt/earthworm/earthworm-7.6-5454/include  -c -o libcvrt.o libcvrt.c
<snip>
libcvrt.c: In function ‘storemac’:
libcvrt.c:125: warning: passing argument 1 of ‘storeword’ from incompatible pointer type
libcvrt.c:48: note: expected ‘uint8_t **’ but argument is of type ‘pbyte’
libcvrt.c:126: warning: passing argument 1 of ‘storeword’ from incompatible pointer type
libcvrt.c:48: note: expected ‘uint8_t **’ but argument is of type ‘pbyte’
libcvrt.c:127: warning: passing argument 1 of ‘storeword’ from incompatible pointer type
libcvrt.c:48: note: expected ‘uint8_t **’ but argument is of type ‘pbyte’

The errors are caused by an incorrect first argument in the calls to storeword() in the same file:

void storeword (pbyte *p, word w)
<snip>
void storemac (pbyte *p, tsix *mac)
begin

#ifdef ENDIAN_LITTLE
  storeword (*p, (*mac)[2]) ;
  storeword (*p, (*mac)[1]) ;
  storeword (*p, (*mac)[0]) ;
#else
  storeword (*p, (*mac)[0]) ;
  storeword (*p, (*mac)[1]) ;
  storeword (*p, (*mac)[2]) ;
#endif
end

storeword needs to be called with p for the first argument, not *p. For example, see how loadmac() calls loadword() in the same file.

void storemac (pbyte *p, tsix *mac)
begin

#ifdef ENDIAN_LITTLE
  storeword (p, (*mac)[2]) ;
  storeword (p, (*mac)[1]) ;
  storeword (p, (*mac)[0]) ;
#else
  storeword (p, (*mac)[0]) ;
  storeword (p, (*mac)[1]) ;
  storeword (p, (*mac)[2]) ;
#endif
end

I assume this bug report should also be passed along to the upstream provider.

#268 fixed ustime.c: integer constant is too large for ‘long’ type somebody baker
Description

For svn version 5468, FormatUSTime() in src/data_sources/grf2ew/ustime.c gives compiler warnings:

/usr/bin/gcc -c -I../../../include -g -m32 -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I/opt/earthworm/earthworm-7.6-5468/include -D_DEBUG  ustime.c
ustime.c: In function ‘FormatUSTime’:
ustime.c:198: warning: integer constant is too large for ‘long’ type

The offending line is the test for a valid USTIME time:

	if (time == VOID_USTIME) {
		snprintf(string, n, "Undefined");
		return string;
	}

The problem is that VOID_USTIME is defined in ustime.h without a long long integer constant suffix, thus, it is a long, not a long long:

/* Undefined or "void" time value */
#define VOID_USTIME 	0x7FFFFFFFFFFFFFFF

The fix is to add the long long integer constant suffix, either ll or LL:

/* Undefined or "void" time value */
#define VOID_USTIME 	0x7FFFFFFFFFFFFFFFLL

This is standard C99, and works on Linux. I do not know if this works on Solaris or Windows.

#269 fixed hypAssoc.h:38:1: warning: "MAX_PHASES" redefined somebody baker
Description

For svn version 5475, src/seismic_processing/hypAssoc/hypAssoc.c gives compiler warnings:

/usr/bin/gcc -D_REENTRANT -m32 -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I/opt/earthworm/earthworm-7.6-5475/include -m32 -Dlinux -D__i386 -D_LINUX -D_INTEL -D_USE_SCHED  -D_USE_PTHREADS -D_USE_TERMIOS -I/opt/earthworm/earthworm-7.6-5475/include  -c -o hypAssoc.o hypAssoc.c
In file included from hypAssoc.c:17:
hypAssoc.h:38:1: warning: "MAX_PHASES" redefined
In file included from hypAssoc.h:29,
                 from hypAssoc.c:17:
/opt/earthworm/earthworm-7.6-5475/include/read_arc.h:128:1: warning: this is the location of the previous definition

hypAssoc.c is picking up two different definitions for MAX_PHASES.

In src/seismic_processing/hypAssoc/hypAssoc.h, line 38, MAX_PHASES is set to 50:

#define	MAX_PHASES	50

In include/read_arc.h (#include'd by hypAssoc.h), line 128, MAX_PHASES is set to 5000:

#define MAX_PHASES 5000
Note: See TracQuery for help on using queries.