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

[McIDAS #LRH-227193]: Incorrect typing of 3rd parameter to Mcdaytimetosec



Hi Dave,

In a previous email, I noted that the problem with mistyping of
the variables specified as the third parameter to Mcdaytimetosec
was more extensive than I had originally thought.

The following is the list of C routines that call Mcdaytimetosec and
the type of the parameter(s) that is(are) used in the calls:

Routine         Pkg   Type of parameter(s) passed
---------------+-----+---------------------------
servutil.h      X     time_t (via FILELIST struct)
wwdisp.c        X     int *
wwlist.c        X     int *, static int *
wwmisc.c        X     int *
gvaradir.cp     X     time_t *
gvaraget.cp     X     time_t *
lv1butil.c      X     time_t *
mcts.c          X     int * (via TS_TIME struct)
modsks.cp       X     static time_t *
ncdfadir.cp     X     int *
poesadir.cp     X     time_t *
poesaget.cp     X     int *, time_t *
sfcdata.c       X     time_t *
sfcmg.c         X     int *

giniutil.c      SDI   time_t * (via FILELIST struct)
MSAT.c          SDI   time_t *
POES.c          SDI   time_t *
SDIUtil.c       SDI   time_t *

obtgserv.cp     XCD   time_t *
wtxgserv.cp     XCD   static time_t *, time_t *

nowrutil.c      UPC   time_t * (FILELIST struct)

amsradir.cp     XRD   int *
amsraget.cp     XRD   int *
sminadir.cp     XRD   int *
sminaget.cp     XRD   int *
swnd2cdf.c      XRD   time_t *
tminadir.cp     XRD   int *
tminaget.cp     XRD   int *

I have modified all of the routines above that specify use of time_t
to use int in the Unidata McIDAS-X/-XCD/-XRD distribution (I include some
of the XRD routines in Unidata McIDAS).

I am currently testing the newly rebuilt code on 32-bit Fedora Core 5 Linux
and 64-bit Fedora Core 5 Linux.  So far, everything is running without error.
I will be installing the changes in 64-bit builds on Solaris SPARC 5.8 and
5.9 systems and Solaris 10 x86_64 tomorrow (or later tonight :-).

I also reported the changes needed in the XCD routines obtgserv.cp and
wtxgserv.cp to Kevin B. along with mods needed to successful run DMBIN
and DMGRID on big-endian systems.

I also found the likely reason for the use of incorrectly typed variables
to Mcdaytimetosec:  the comment lines and associated man page for
Mcdaytimetosec incorrectly lists the type of the third parameter to
Mcdaytimetosec:

      #include <time.h>
      int
      Mcdaytimetosec (int day, int hms, time_t *secs)

should instead be:

      int
      Mcdaytimetosec (int day, int hms, int *secs)

The first form does not match the function declaration of Mcdaytimetosec
in daytime.c and mcidas.h:

daytime.c:

int Mcdaytimetosec (int day, int hms, int *secs)

mcidas.h:

extern int
Mcdaytimetosec ( int, int, int *);

At one point I thought about changing the parameter passed to Mcdaytimetosec,
but I abandoned that approach because of:

- the Fortran interface to Mcdaytimetosec, mcdaytimetosec_

- the equal number of routines that correctly use an 'int *' for the
  the third parameter to Mcdaytimetosec

I am not sure who maintains XRD routines, so I am unsure who will make
the modifications to routines like swnd2cdf.c.  Can you identify who
the person(s) who maintain XRD?

Cheers,

Tom
****************************************************************************
Unidata User Support                                    UCAR Unidata Program
(303) 497-8642                                                 P.O. Box 3000
address@hidden                                   Boulder, CO 80307
----------------------------------------------------------------------------
Unidata HomePage                       http://www.unidata.ucar.edu
****************************************************************************