bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] gsl version 1.5 - A few small source code issues


From: Peter Rockett
Subject: [Bug-gsl] gsl version 1.5 - A few small source code issues
Date: Fri, 30 Jul 2004 19:37:47 +0100

A couple of small things in the source code of version 1.5:

1) In "utils/stroul.c". Shouldn't line 23 read:

#include "strtol.c" 

instead of 

#include <strtol.c>


2)The functions in the /util sub-directory seem to implement things like
memcpy() if you don't have a system-defined version of memcpy(), etc. A
small point but wouldn't these be better practice if they were guarded
by the preprocessor variables defined in config.h. For example, the gsl
version of memcpy() should be guarded by #if !HAVE_MEMCPY ... #endif,
etc. I think this should apply to strol.c, stroul.c, memcpy.c, memmove.c
and strdup.c. (I guess these may be fairly rarely functions used since I
think all the functions in /util are standard POSIX things anyway and
most compilers will have these as built-ins.)

Incidentally, shouldn't functions like gsl_vector_memcpy and
gsl_matrix_memcpy use the memcpy function for efficiency rather than
nested for-loops? If the compiler doesn't have memcpy then the version
in /utils would be called instead. Should the /util functions be
inlines, again for efficiency?

3) util/memcpy.c, utils/memmove.c and utils/strdup.c use the
HAVE_CONFIG_H preprocessor variable. I cannot see where this is set - is
this a now obsolete relic from an earlier version?


Best wishes,


Peter Rockett





reply via email to

[Prev in Thread] Current Thread [Next in Thread]