lammps_extract_fix in library.h and library.cpp

I found an inconsistency in library.h versus library.cpp. The
prototype for "lammps_extract_fix" is:

   void *lammps_extract_fix(void *, int, int, int, int);

whereas the definition is:

void *lammps_extract_fix(void *ptr, char *id, int style, int type,
        int i, int j)

Is this a mistake, or am I missing a second (overloaded) definition that
has more arguments?

I think "int" and "char*" variables are the same size on most 64-bit
compilers, so that may also explain why there have been no serious
problems (yet).

Karl D. Hammond

"You can never know everything, and part of what you know is always
   wrong. A portion of wisdom lies in knowing that. A portion of courage
   lies in going on anyway."
"Nothing ever goes as you expect. Expect nothing, and you will not be
   surprised."

karl,

I found an inconsistency in library.h versus library.cpp. The

actually you found a bug.

prototype for "lammps_extract_fix" is:

   void *lammps_extract_fix(void *, int, int, int, int);

whereas the definition is:

void *lammps_extract_fix(void *ptr, char *id, int style, int type,
        int i, int j)

Is this a mistake, or am I missing a second (overloaded) definition that
has more arguments?

the library interface is supposed to provide function calls
with C bindings and C doesn't allow overloading. The prototype
has to be:

void *lammps_extract_fix(void *, char *,int, int, int, int);

I think "int" and "char*" variables are the same size on most 64-bit
compilers, so that may also explain why there have been no serious
problems (yet).

that is not correct. int would be 32-bit on most 64-bit platforms.

the mismatched prototype has a different effect:
it will lead to lammps_extract_fix() being compiled
with C++ bindings, and thus it should not even be
callable from C (or fortran).

cheers,
    axel.

Just amended library.h to have the correct prototype.
Will be in the next patch.

Thanks,
Steve