Ticket #34066: patch-bugfixes-r9794.diff

File patch-bugfixes-r9794.diff, 40.8 KB (added by florian@…, 12 years ago)

patchfile 1a

  • configure.ac

    old new  
    3333DOCYEAR="2012"
    3434GSHHS_VERSION=2.2.0
    3535SVN_VERSION=0
     36dnl see whether subversion is installed
     37AC_PATH_PROG([SVNVERSIONCOMMAND], [svnversion], [])
     38dnl use svnversion to record the current repository revision only if
     39dnl subversion is installed and we are in a working copy
     40if test "$SVN_VERSION" != "0" && test -x "$SVNVERSIONCOMMAND"; then
     41  SVN_VERSION_STRING=`"$SVNVERSIONCOMMAND" -n '.'`
     42  if test "$SVN_VERSION_STRING" == "exported" || \
     43     test "$SVN_VERSION_STRING" == "Unversioned directory"; then
     44    SVN_VERSION=0
     45  fi
     46fi
    3647dnl
    3748dnl -----------------------------------------------------------------
    3849dnl Specify the minimal supplement directories
     
    8293AC_SUBST(FTPSITE)
    8394AC_SUBST(GSHHS_VERSION)
    8495AC_SUBST(SVN_VERSION)
     96AC_SUBST(SVN_VERSION_STRING)
    8597AC_SUBST(GMT_MAJOR_VERSION)
    8698AC_SUBST(GMT_MINOR_VERSION)
    8799AC_SUBST(GMT_RELEASE_VERSION)
  • src/gmt_plot.c

    old new  
    41934193        /* First crudely estimate the boundingbox coordinates */
    41944194
    41954195        if (GMT_ps.overlay && (fp = fopen (info, "r")) != NULL) {       /* Must get previous boundingbox values */
    4196                 fscanf (fp, "%d %d %lf %lf %lf %lf %lf %lf\n", &(new->portrait), &(new->clip_level), &orig_x0, &orig_y0, &old_x0, &old_y0, &old_x1, &old_y1);
     4196                (void)fscanf (fp, "%d %d %lf %lf %lf %lf %lf %lf\n", &(new->portrait), &(new->clip_level), &orig_x0, &orig_y0, &old_x0, &old_y0, &old_x1, &old_y1);
    41974197                fclose (fp);
    41984198                x0 = orig_x0;
    41994199                y0 = orig_y0;
  • src/gmt_version.c

    old new  
    2525
    2626#include "gmt.h"
    2727
    28 char *GMT_version ()
    29 {
    30         static char text[GMT_LONG_TEXT];
    3128#if SVN_VERSION
    32         int svn_revision =
    33 #include "gmt_svn_revision.h"
    34         ;
    35         sprintf (text, PACKAGE_VERSION "-%d" GMT_VER_64, svn_revision);
     29#define SVN_SUFFIX "_r" SVN_VERSION_STRING
    3630#else
    37         sprintf (text, PACKAGE_VERSION GMT_VER_64);
     31#define SVN_SUFFIX ""
    3832#endif
     33
     34char *GMT_version ()
     35{
     36        static char text[GMT_LONG_TEXT];
     37        sprintf (text, PACKAGE_VERSION SVN_SUFFIX GMT_VER_64);
    3938        return (text);
    4039}
  • src/gmt_version.h.in

    old new  
     1/* @configure_input@ */
     2
    13#define SVN_VERSION @SVN_VERSION@
     4#define SVN_VERSION_STRING "@SVN_VERSION_STRING@"
    25#define PACKAGE_VERSION "@PACKAGE_VERSION@"
    36#if SVN_VERSION
    47#define GMT_STRING "@PACKAGE_STRING@ (SVN)"
  • src/mgd77/mgd77.c

    old new  
    21102110
    21112111int MGD77_Write_File_asc (char *file, struct MGD77_CONTROL *F, struct MGD77_DATASET *S)   /* Will write all MGD77 records in current file */
    21122112{
    2113         int err;
     2113        int err = 0;
    21142114
    21152115        if (MGD77_Open_File (file, F, MGD77_WRITE_MODE)) return (-1);
    21162116        switch (F->format) {
     
    22982298        GMT_LONG pos = 0;
    22992299        GMT_cal_rd rata_die;
    23002300        char line[BUFSIZ], p[BUFSIZ], r_date[9];
    2301         double tz, secs, r_time;
     2301        double tz, secs, r_time = 0.0;
    23022302
    23032303        if (!(fgets (line, BUFSIZ, F->fp))) return (MGD77_ERROR_READ_ASC_DATA);         /* End of file? */
    23042304        GMT_chop (line);        /* Get rid of CR or LF */
  • src/pshistogram.c

    old new  
    340340        z_project.view_elevation = Ctrl->E.elevation;
    341341        F.cumulative = Ctrl->Q.active;
    342342        F.center_box = Ctrl->F.active;
    343         if (Ctrl->I.active) gmtdefs.verbose = TRUE;
     343        if (Ctrl->I.active && Ctrl->I.mode == 0) gmtdefs.verbose = TRUE;
    344344        if (!Ctrl->I.active && !project_info.region_supplied) automatic = TRUE;
    345345
    346346        if (Ctrl->C.active)  GMT_read_cpt (Ctrl->C.file);
  • src/pslegend.c

    old new  
    620620        fprintf (fpo, "\n");
    621621
    622622        if (!Ctrl->S.active) {  /* Add auto-delete command at the end of the script and then execute it */
     623                int err = 0;
    623624                if (fpo != stdout) fclose (fpo);
    624625                if (gmtdefs.verbose) fprintf (stderr, "%s: Executing and removing legend script\n", GMT_program);
    625626#ifdef WIN32
    626                 system (script);
     627                err = system (script);
    627628#else
    628629                sprintf (sub, "sh %s", script);
    629                 system (sub);
     630                err = system (sub);
    630631#endif
    631632                remove (script);
     633                if (err) fprintf (stderr, "%s: System call return with non-zero status %d\n", GMT_program, err);
    632634        }
    633635        else if (fpo != stdout)
    634636                fclose (fpo);
  • src/xgrid/xGridEdit.c

    old new  
    2525
    2626/****   Local procedures  ****/
    2727
    28 static void usage (); /* String argv[] */
    29 static void quitGridEdit (); /* Widget w, void * callData, void * clientData */
     28static void usage (String argv[]);
     29static void quitGridEdit (Widget w, void * callData, void * clientData);
    3030
    31 static void usage (argv)
    32         String argv[];
     31static void usage (String argv[])
    3332{
    3433  printf("Usage: %s <grid file name>\n", argv[0]);
    3534}
    3635
    37 static void quitGridEdit (w, call, client)
    38         Widget  w;
    39         void *  call;
    40         void *  client;
     36static void quitGridEdit (Widget w __attribute__((unused)),
     37                          void *call __attribute__((unused)),
     38                          void *client __attribute__((unused)))
    4139{
    4240  /* There may be more than one callback on the Quit button, and
    4341     the order of execution is undefined. We therefore can't
  • src/xgrid/xgrid_Canvas.c

    old new  
    2222
    2323/****   Methods for Canvas.     ****/
    2424
    25 static void CanvasRealize (self, mask, attributes)
    26         Widget  self;
    27         XtValueMask * mask;
    28         XSetWindowAttributes * attributes;
     25static void CanvasRealize (Widget self, XtValueMask *mask, XSetWindowAttributes *attributes)
    2926{
    3027  WidgetClass super;
    3128 
     
    3633  XtCallCallbackList(self, ((CanvasWidget)self)->canvas.realize_callback, NULL);
    3734}
    3835
    39 static void CanvasResize (self)
    40         Widget self;
     36static void CanvasResize (Widget self)
    4137{
    4238  XRectangle    bounds;
    4339 
     
    5046        ((CanvasWidget)self)->canvas.resize_callback, &bounds);
    5147}
    5248
    53 static void CanvasExpose (self, event, region)
    54         Widget   self;
    55         XEvent * event;
    56         Region   region;
     49static void CanvasExpose (Widget self, XEvent *event __attribute__((unused)), Region region)
    5750{
    5851  XtCallCallbackList(self,
    5952        ((CanvasWidget)self)->canvas.expose_callback, region);
    6053}
    6154
    62 static XtGeometryResult CanvasQueryGeometry (self, request, reply)
    63         Widget             self;
    64         XtWidgetGeometry * request;
    65         XtWidgetGeometry * reply;
     55static XtGeometryResult CanvasQueryGeometry (Widget self, XtWidgetGeometry *request,
     56        XtWidgetGeometry *reply)
    6657{
    6758  XtGeometryHandler instMethod;
    6859 
     
    117108
    118109/****   Convenience functions   ****/
    119110
    120 XFontStruct * XtCanvasFont (self)
    121         CanvasWidget self;
     111XFontStruct * XtCanvasFont (Widget self)
    122112{
    123113  XtCheckSubclass(self, canvasWidgetClass, "XtCanvasFont");
    124   return self->canvas.font;
     114  return ((CanvasWidget)self)->canvas.font;
    125115}
    126116
    127 void * XtCanvasData (self)
    128         CanvasWidget self;
     117void * XtCanvasData (Widget self)
    129118{
    130119  XtCheckSubclass(self, canvasWidgetClass, "XtCanvasData");
    131   return self->canvas.data;
     120  return ((CanvasWidget)self)->canvas.data;
    132121}
    133 
  • src/xgrid/xgrid_Canvas.h

    old new  
    7676
    7777/**** Convenience functions ****/
    7878
    79 extern XFontStruct * XtCanvasFont (); /* Widget w */
    80 extern void * XtCanvasData (); /* Widget w */
     79extern XFontStruct * XtCanvasFont (Widget w);
     80extern void * XtCanvasData (Widget w);
    8181
    8282#endif /* _Canvas_h */
  • src/xgrid/xgrid_GMTgrid.c

    old new  
    1717#include "xgrid_utility.h"
    1818#include "xgrid_GMTgrid.h"
    1919
    20 static void clear (grid)
    21         GMTGrid * grid;
     20static void clear (GMTGrid *grid)
    2221{
    2322  grid->methods.width     = 0;
    2423  grid->methods.height    = 0;
     
    4847  memset(grid->header.remark, 0, sizeof(grid->header.remark));
    4948}
    5049
    51 static void readFromFile (GMTGrid *grid, String fileName, int *status)
     50static void readFromFile (Grid *_grid, String fileName, int *status)
    5251{
     52    GMTGrid *grid = (GMTGrid *)_grid;
    5353    if ((*status = GMT_read_grd_info (fileName, &grid->header)))
    5454      return;
    5555
     
    6666  return;
    6767}
    6868
    69 static void writeToFile (grid, fileName, status)
    70         GMTGrid * grid;
    71         String    fileName;
    72         int *     status;
     69static void writeToFile (Grid *_grid, String fileName, int *status)
    7370{
     71  GMTGrid *grid = (GMTGrid *)_grid;
    7472  *status = GMT_write_grd (fileName, &grid->header, grid->value, 0.0, 0.0, 0.0,
    7573                           0.0, GMT_pad, FALSE);
    7674}
    7775
    78 static void dispose (grid)
    79         GMTGrid * grid;
     76static void dispose (Grid *_grid)
    8077{
     78  GMTGrid *grid = (GMTGrid *)_grid;
    8179  free(grid->value);
    8280  grid->value = NULL;
    8381}
    8482
    8583#if 0
    86 static void dumpGrid (grid)
    87         GMTGrid * grid;
     84static void dumpGrid (GMTGrid *grid)
    8885{
    8986  int outer, inner;
    9087  GridPoint  gPt;
     
    115112}
    116113#endif
    117114
    118 static void getIndexes (grid, coord, index)
    119         GMTGrid *   grid;
    120         GridPoint * coord;
    121         XPoint *    index;
     115static void getIndexes (Grid *_grid, GridPoint *coord, XPoint *index)
    122116{
    123117  int column, row;
     118  GMTGrid *grid = (GMTGrid *)_grid;
    124119 
    125120  column = (int)((coord->x - grid->header.x_min) / grid->header.x_inc);
    126121  row    = (int)((coord->y - grid->header.y_min) / grid->header.y_inc);
     
    129124  index->y = grid->header.ny - row;
    130125}
    131126
    132 static void getCoords (grid, index, coord)
    133         GMTGrid *   grid;
    134         XPoint *    index;
    135         GridPoint * coord;
     127static void getCoords (Grid *_grid, XPoint *index, GridPoint *coord)
    136128{
     129  GMTGrid *grid = (GMTGrid *)_grid;
    137130  coord->x = grid->header.x_min + index->x * grid->header.x_inc;
    138131  coord->y = grid->header.y_max - index->y * grid->header.y_inc;
    139132}
    140133
    141 static void set (grid, xIndex, yIndex, value)
    142         GMTGrid * grid;
    143         int       xIndex;
    144         int       yIndex;
    145         GridValue value;
     134static void set (Grid *_grid, int xIndex, int yIndex, GridValue value)
    146135{
     136  GMTGrid *grid = (GMTGrid *)_grid;
    147137  grid->value[yIndex * grid->header.nx + xIndex] = value;
    148138}
    149139
    150 static GridValue get (grid, xIndex, yIndex)
    151         GMTGrid * grid;
    152         int       xIndex;
    153         int       yIndex;
     140static GridValue get (Grid *_grid, int xIndex, int yIndex)
    154141{
     142  GMTGrid *grid = (GMTGrid *)_grid;
    155143
    156144/* Original Version had "grid->header.ny": should be "grid->header.nx */
    157145/* Fixed 8/4/93 by J. Lillibrige @ NOAA/NOS to eliminate core dumps!  */
  • src/xgrid/xgrid_Panner.c

    old new  
    66#define Min(a,b) ((a)<(b)?(a):(b))
    77#define Max(a,b) ((a)>(b)?(a):(b))
    88
    9 #include "xgrid_PannerP.h"
    109#include <stddef.h>
    1110
     11#include "xgrid_utility.h"
     12
     13#include "xgrid_PannerP.h"
     14
    1215static XtResource resources[] = {
    1316#define offset(field) XtOffset(PannerWidget, panner.field)
    1417  { XtNcanvas, XtCCanvas, XtRWidget, sizeof(Widget),
     
    4548/****   Methods for Panner.     ****/
    4649
    4750/* At initialisation, create our two scrollbar widgets */
    48 static void PannerInitialize (Widget request, Widget result, ArgList args, Cardinal *nargs)
     51static void PannerInitialize (Widget request __attribute__((unused)),
     52                              Widget result, ArgList args __attribute__((unused)),
     53                              Cardinal *nargs __attribute__((unused)))
    4954{
    5055  Widget bar;
    5156  PanScrollRec *horizontal = &((PannerWidget)result)->panner.horizontal;
     
    8590/* If range or position changed, recalculate appearance
    8691   of scrollbars. Don't bother checking for width, height
    8792   resources because the resize method will catch those.   */
    88 static Boolean PannerSetValues (Widget old, Widget request, Widget new, ArgList args, Cardinal *nargs)
     93static Boolean PannerSetValues (Widget old, Widget request __attribute__((unused)),
     94                                Widget new, ArgList args __attribute__((unused)),
     95                                Cardinal *nargs __attribute__((unused)))
    8996{
    9097  PannerWidget oldp, newp;
    9198 
     
    136143  recalculateBar(&(self->panner.vertical));
    137144}
    138145
    139 static void recalculateBar (bar)
    140         PanScrollRec * bar;
     146static void recalculateBar (PanScrollRec * bar)
    141147{
    142148  float top, size;
    143149 
     
    227233        2. You can't scroll past the bottom of the data,
    228234        ie the thumb is always fully visible    ****/
    229235
    230 static void jumpProc (bar, data, fraction)
    231         Widget          bar;
    232         PanScrollRec *  data;
    233         float *         fraction;
     236static void jumpProc (Widget bar, PanScrollRec *data, float *fraction)
    234237{
    235238  float         thumbSize, scaleFrac;
    236239  int           previous;
     
    266269        to the position of the cursor in the bar.
    267270                                                ****/
    268271
    269 static void scrollProc (bar, data, position)
    270         Widget          bar;
    271         PanScrollRec *  data;
    272         int             position;
     272static void scrollProc (Widget bar, PanScrollRec *data, int position)
    273273{
    274274  int       distance;
    275275  Position  previous;
     
    299299
    300300/****   Convenience functions   ****/
    301301
    302 void XtSetPannerCanvas (self, canvas)
    303         PannerWidget    self;
    304         Widget  canvas;
     302void XtSetPannerCanvas (Widget self, Widget canvas)
    305303{
    306304  XtCheckSubclass(self, pannerWidgetClass, "XtSetPannerCanvas");
    307   XtVaSetValues((Widget)self, XtNcanvas, canvas, NULL);
     305  XtVaSetValues(self, XtNcanvas, canvas, NULL);
    308306}
    309307
    310 int XtPannerXPosition (self)
    311         PannerWidget self;
     308int XtPannerXPosition (Widget self)
    312309{
    313310  XtCheckSubclass(self, pannerWidgetClass, "XtPannerXPosition");
    314   return self->panner.horizontal.position;
     311  return ((PannerWidget)self)->panner.horizontal.position;
    315312}
    316313
    317 int XtPannerYPosition (self)
    318         PannerWidget self;
     314int XtPannerYPosition (Widget self)
    319315{
    320316  XtCheckSubclass(self, pannerWidgetClass, "XtPannerYPosition");
    321   return self->panner.vertical.position;
     317  return ((PannerWidget)self)->panner.vertical.position;
    322318}
    323319
    324 void XtSetPannerXPosition (self, position)
    325         PannerWidget     self;
    326         int position;
     320void XtSetPannerXPosition (Widget self, int position)
    327321{
    328322  XtCheckSubclass(self, pannerWidgetClass, "XtSetPannerXPosition");
    329   XtVaSetValues((Widget)self, XtNxPosition, position, NULL);
     323  XtVaSetValues(self, XtNxPosition, position, NULL);
    330324}
    331325
    332 void XtSetPannerYPosition (self, position)
    333         PannerWidget     self;
    334         int position;
     326void XtSetPannerYPosition (Widget self, int position)
    335327{
    336328  XtCheckSubclass(self, pannerWidgetClass, "XtSetPannerYPosition");
    337   XtVaSetValues((Widget)self, XtNyPosition, position, NULL);
     329  XtVaSetValues(self, XtNyPosition, position, NULL);
    338330}
    339331
    340 void XtSetPannerXRange (self, range)
    341         PannerWidget     self;
    342         int range;
     332void XtSetPannerXRange (Widget self, int range)
    343333{
    344334  XtCheckSubclass(self, pannerWidgetClass, "XtSetPannerXRange");
    345   XtVaSetValues((Widget)self, XtNxRange, range, NULL);
     335  XtVaSetValues(self, XtNxRange, range, NULL);
    346336}
    347337
    348 void XtSetPannerYRange (self, range)
    349         PannerWidget     self;
    350         int range;
     338void XtSetPannerYRange (Widget self, int range)
    351339{
    352340  XtCheckSubclass(self, pannerWidgetClass, "XtSetPannerYRange");
    353   XtVaSetValues((Widget)self, XtNyRange, range, NULL);
     341  XtVaSetValues(self, XtNyRange, range, NULL);
    354342}
    355 
  • src/xgrid/xgrid_Panner.h

    old new  
    8484
    8585/* Convenience functions */
    8686
    87 extern void     XtSetPannerCanvas (); /* Widget w, Widget canvas */
     87extern void     XtSetPannerCanvas (Widget, Widget canvas); /* */
    8888
    89 extern int      XtPannerXPosition (); /* Widget w */
    90 extern int      XtPannerYPosition (); /* Widget w */
     89extern int      XtPannerXPosition (Widget); /* */
     90extern int      XtPannerYPosition (Widget); /* Widget w */
    9191
    92 extern void     XtSetPannerXPosition (); /* Widget w, int x */
    93 extern void     XtSetPannerYPosition (); /* Widget w, int y */
    94 extern void     XtSetPannerXRange ();    /* Widget w, int x */
    95 extern void     XtSetPannerYRange ();    /* Widget w, int y */
     92extern void     XtSetPannerXPosition (Widget, int); /* Widget w, int x */
     93extern void     XtSetPannerYPosition (Widget, int); /* Widget w, int y */
     94extern void     XtSetPannerXRange (Widget, int);    /* Widget w, int x */
     95extern void     XtSetPannerYRange (Widget, int);    /* Widget w, int y */
    9696
    9797#endif /* _Panner_h */
  • src/xgrid/xgrid_Xutility.c

    old new  
    1414
    1515#include "xgrid_Xutility.h"
    1616
    17 Dimension XtWidth (w)
    18         Widget w;
     17Dimension XtWidth (Widget w)
    1918{
    2019  return w->core.width;
    2120}
    2221
    23 Dimension XtHeight (w)
    24         Widget w;
     22Dimension XtHeight (Widget w)
    2523{
    2624  return w->core.height;
    2725}
    2826
    29 Widget XtShell (w)
    30         Widget w;
     27Widget XtShell (Widget w)
    3128{
    3229  while (w != NULL && !XtIsSubclass(w, shellWidgetClass))
    3330    w = XtParent(w);
     
    3633
    3734/****   Wait until all windows redrawn  ****/
    3835
    39 void WaitNoExposes (w)
    40         Widget w;
     36void WaitNoExposes (Widget w)
    4137{
    4238  XEvent        event;
    4339  Display *     display;
     
    5652
    5753/****   Highlight things        ****/
    5854
    59 void InvertWidget (w)
    60   Widget w;
     55void InvertWidget (Widget w)
    6156{
    6257  Pixel foreground, background;
    6358
  • src/xgrid/xgrid_Xutility.h

    old new  
    44
    55#define XSetPoint(pt, xVal, yVal) (pt).x = (xVal); (pt).y = (yVal)
    66
    7 extern Dimension XtWidth ();
    8                 /* Widget w */
     7extern Dimension XtWidth (Widget);      /* Widget w */
    98
    10 extern Dimension XtHeight ();
    11                 /* Widget w */
     9extern Dimension XtHeight (Widget);     /* Widget w */
    1210
    13 extern Widget XtShell ();
    14                 /* Widget w */
     11extern Widget XtShell (Widget);         /* Widget w */
    1512               
    16 extern void   WaitNoExposes ();
    17                 /* Widget w */
     13extern void   WaitNoExposes (Widget);   /* Widget w */
    1814
    19 extern void InvertWidget ();
    20                 /* Widget w */
     15extern void InvertWidget (Widget);      /* Widget w */
    2116
    2217#endif
  • src/xgrid/xgrid_controls.c

    old new  
    2121
    2222static Widget quitButton;
    2323
    24 Widget createControlBar (name, parent, args, nargs)
    25         String name;
    26         Widget parent;
    27         Arg    args[];
    28         int    nargs;
     24Widget createControlBar (String name, Widget parent, Arg args[], int nargs)
    2925{
    3026  Widget result;
    3127  Arg    list[32];
     
    5450   chooses to quit. Such callbacks must NOT call exit because
    5551   the order in which callbacks are called is undefined.  */
    5652   
    57 void addQuitCallback (callback, clientData)
    58         XtCallbackProc callback;
    59         void *         clientData;
     53void addQuitCallback (XtCallbackProc callback, void *clientData)
    6054{
    6155  XtAddCallback(quitButton, XtNcallback, callback, clientData);
    6256}
    63 
  • src/xgrid/xgrid_controls.h

    old new  
    22#ifndef _controls_
    33#define _controls_
    44
    5 extern Widget   createControlBar ();
     5extern Widget   createControlBar (String name, Widget parent, Arg args[], int nargs);
    66                /* String name, Widget parent, Arg args[], int nargs */
    77
    8 extern void addQuitCallback ();
     8extern void addQuitCallback (XtCallbackProc callback, void * clientData);
    99                /* XtCallbackProc callback, void * clientData */
    1010
    1111#endif
  • src/xgrid/xgrid_grid.h

    old new  
    2727
    2828/****   Grid methods ****/
    2929
    30 typedef void      (* GridProc) (); /* Grid * grid, ... */
    31 typedef GridValue (* GridFunc) (); /* Grid * grid, ... */
    32 
    3330/****   Grid data structure     ****/
    3431
    35 typedef struct {
     32typedef struct _Grid_s {
    3633        int      width;
    3734        int      height;
    3835        int      coordType; /* Nodes or pixels */
    3936        /****   Methods ****/
    40         /* dispose (Grid * grid ) */
    41         GridProc dispose;
    42         /* readFromFile (Grid * grid, String fileName, int * status) */
    43         GridProc readFromFile;
    44         /* writeToFile (Grid * grid, String fileName, int * status) */
    45         GridProc writeToFile;
    46         /* getIndexes (Grid * grid, GridPoint * coords, XPoint * indexes) */
    47         GridProc getIndexes;
    48         /* getCoords (Grid * grid, XPoint * indexes, GridPoint * coords) */
    49         GridProc getCoords;
    50         /* set (Grid * grid, int xIndex, int yIndex, GridValue value) */
    51         GridProc set;
    52         /* get (Grid * grid, int xIndex, int yIndex) */
    53         GridFunc get;
     37        void (*dispose) (struct _Grid_s * grid );
     38        void (*readFromFile) (struct _Grid_s *grid, String fileName, int * status);
     39        void (*writeToFile) (struct _Grid_s * grid, String fileName, int * status);
     40        void (*getIndexes) (struct _Grid_s * grid, GridPoint * coords, XPoint * indexes);
     41        void (*getCoords) (struct _Grid_s * grid, XPoint * indexes, GridPoint * coords);
     42        void (*set) (struct _Grid_s *grid, int xIndex, int yIndex, GridValue value);
     43        GridValue (*get) (struct _Grid_s * grid, int xIndex, int yIndex);
    5444        } Grid;
    5545
    5646/****   Convenience macros to make code cleaner ****/
  • src/xgrid/xgrid_messages.c

    old new  
    1616
    1717Widget  messageWidget = NULL;
    1818
    19 Widget createMessageLine (name, parent, args, nargs)
    20         String name;
    21         Widget parent;
    22         Arg    args[];
    23         int    nargs;
     19Widget createMessageLine (String name, Widget parent, Arg args[], int nargs)
    2420{
    2521  Widget result;
    2622  Arg    list[32];
     
    4036  return result;
    4137}
    4238
    43 void setMessageLine (newMessage)
    44         String newMessage;
     39void setMessageLine (String newMessage)
    4540{
    4641  if (messageWidget != NULL)
    4742    XtVaSetValues(messageWidget, XtNlabel, newMessage, NULL);
    4843}
    49 
  • src/xgrid/xgrid_messages.h

    old new  
    44
    55extern Widget   messageWidget;
    66
    7 extern Widget   createMessageLine ();
    8                 /* String name, Widget parent, Arg args[], int nargs */
     7extern Widget   createMessageLine (String name, Widget parent, Arg args[], int nargs);
    98
    10 extern void     setMessageLine ();
    11                 /* String newMessage */
     9extern void     setMessageLine (String newMessage);
    1210#endif
    1311
  • src/xgrid/xgrid_textInput.c

    old new  
    7676static Widget   inputField;
    7777static Widget   undoButton;
    7878
    79 Widget createTextInputArea (parent)
    80         Widget parent;
    81 {
     79Widget createTextInputArea (Widget parent) {
    8280  Widget label;
    8381 
    8482  undoButton = XtVaCreateManagedWidget("undo", commandWidgetClass, parent,
     
    113111 
    114112}
    115113
    116 void setViewForInput (data)
    117         TextViewData * data;
    118 {
     114void setViewForInput (TextViewData *data) {
    119115  theView = data;
    120116  clearInputSelection();
    121117  clearUndo();
     
    138134  XtSetSensitive(undoButton, False);
    139135}
    140136
    141 void setInputSelection (col, row)
    142         int     col;
    143         int     row;
    144 {
     137void setInputSelection (int col, int row) {
    145138  char str[64];
    146139
    147140  selection.col = col;
     
    158151  XawTextSetInsertionPoint(inputField, strlen(str));
    159152}
    160153
    161 static void Beep (w, event, params, nparams)
    162         Widget          w;
    163         XEvent *        event;
    164         String *        params;
    165         Cardinal *      nparams;
    166 {
     154static void Beep (Widget w,
     155        XEvent *        event __attribute__((unused)),
     156        String *        params __attribute__((unused)),
     157        Cardinal *      nparams __attribute__((unused))) {
    167158  XBell(XtDisplay(w), 100);
    168159}
    169160
    170 static void EnterNewValue (w, event, params, nparams)
    171         Widget          w;
    172         XEvent *        event;
    173         String *        params;
    174         Cardinal *      nparams;
     161static void EnterNewValue (Widget w __attribute__((unused)),
     162        XEvent * event __attribute__((unused)),
     163        String * params __attribute__((unused)),
     164        Cardinal * nparams __attribute__((unused)))
    175165{
    176166  GridValue newValue;
    177167  String    field;
     
    198188  gridHasChanged = True;
    199189}
    200190
    201 static void undoNewValue (w, clientData, callData)
    202         Widget  w;
    203         void *  clientData;
    204         void *  callData;
     191static void undoNewValue (Widget w __attribute__((unused)),
     192        void * clientData __attribute__((unused)),
     193        void * callData __attribute__((unused)))
    205194{
    206195  XPoint    index;
    207196  GridPoint coord;
  • src/xgrid/xgrid_textInput.h

    old new  
    11#ifndef _TEXTINPUT_
    22#define _TEXTINPUT_
    33
    4 extern Widget createTextInputArea (); /* Widget parent */
     4#include "xgrid_textView.h"
    55
    6 extern void setViewForInput (); /* TextViewData * data */
     6extern Widget createTextInputArea (Widget parent); /* */
    77
    8 extern void clearInputSelection (); /* void */
    9 extern void setInputSelection (); /* int col, int row */
     8extern void setViewForInput (TextViewData * data); /*  */
     9
     10extern void clearInputSelection (void); /*  */
     11extern void setInputSelection (int col, int row); /*  */
    1012
    1113#endif
    1214
  • src/xgrid/xgrid_textView.c

    old new  
    4343
    4444/****   Local procedures        ****/
    4545
    46 static void handleRealize (); /* Widget w, TextViewData * data, void * call */
    47 static void handleExpose (); /* Widget w, void * data, Region area */
    48 static void createContexts (); /* Widget w, TextViewData * data */
    49 
    50 static void scrollHorizontal (); /* Widget w, TextViewData * data, int x */
    51 static void scrollVertical (); /* Widget w, TextViewData * data, int y */
    52 
    53 static void redrawValues (); /* Widget w,
    54                         Position left, Position top,
    55                         Dimension width, Dimension height */
    56 
    57 static void highlightCell (); /* Widget w, TextViewData * data, CellInfo * cell */
    58 static void lowlightCell ();  /* Widget w, CellInfo * cell */
    59 
    60 static void CursorMovement (); /* Widget w, XEvent * event,
    61                         String * params, Cardinal * nparams */
    62 static void ClearMessage (); /* Widget w, XEvent * event,
    63                         String * params, Cardinal * nparams */
    64 static void SelectValue (); /* Widget w, XEvent * event,
    65                         String * params, Cardinal * nparams */
     46static void handleRealize (Widget w, XtPointer, XtPointer);
     47static void handleExpose (Widget w, XtPointer, XtPointer);
     48static void createContexts (Widget w, TextViewData * data);
     49
     50static void scrollHorizontal (Widget w, XtPointer, XtPointer);
     51static void scrollVertical (Widget w, XtPointer, XtPointer);
     52
     53static void redrawValues (Widget w, Position left, Position top, Dimension width, Dimension height);
     54
     55static void highlightCell (Widget w, TextViewData * data, CellInfo * cell);
     56static void lowlightCell (Widget w, CellInfo * cell);
     57
     58static void CursorMovement (Widget w, XEvent * event, String * params, Cardinal * nparams);
     59static void ClearMessage (Widget w, XEvent * event, String * params, Cardinal * nparams);
     60static void SelectValue (Widget w, XEvent * event, String * params, Cardinal * nparams);
    6661
    6762static XtResource ViewResourceList[] = {
    6863  { XtNgrid, XtCGrid, XtRPointer, sizeof(XtPointer),
     
    9388
    9489/****   Initialization  ****/
    9590
    96 Widget createTextView (name, parent, args, nargs)
    97         String  name;
    98         Widget  parent;
    99         Arg     args[];
    100         int     nargs;
     91Widget createTextView (String   name,
     92        Widget  parent,
     93        Arg     args[],
     94        int     nargs)
    10195{
    10296  Widget result;
    10397  TextViewData * data;
     
    138132  return result;
    139133}
    140134
    141 void setTextViewGrid (view, grid)
    142         Widget  view;
    143         Grid *  grid;
     135void setTextViewGrid (Widget    view, Grid *    grid)
    144136{
    145137  TextViewData * data;
    146138 
     
    153145    XClearArea(XtDisplay(view), XtWindow(view), 0, 0, 0, 0, True);   
    154146}
    155147
    156 void recalculateDisplayParameters (view)
    157         Widget  view;
     148void recalculateDisplayParameters (Widget view)
    158149{
    159150  TextViewData * data;
    160151  XFontStruct *  font;
     
    187178  }
    188179}
    189180
    190 void redrawGridValue (view, col, row)
    191         Widget  view;
    192         int     col;
    193         int     row;
     181void redrawGridValue (Widget view, int  col, int row)
    194182{
    195183  TextViewData * data;
    196184  int x, y;
     
    206194        window has been created, so do that when we
    207195        are realized.           ****/
    208196
    209 static void createContexts (view, data)
    210         Widget         view;
    211         TextViewData * data;
     197static void createContexts (Widget view, TextViewData *data)
    212198{
    213199  XFontStruct *  font;
    214200  XGCValues      gcv;
     
    239225                        GCForeground | GCBackground | GCFont, &gcv);
    240226}
    241227
    242 static void handleRealize (w, data, call)
    243         Widget w;
    244         TextViewData * data;
    245         void * call;
     228static void handleRealize (Widget w,
     229        XtPointer client_data,
     230        XtPointer call_data __attribute__((unused)))
    246231{
    247   createContexts(w, data);
     232  createContexts(w, client_data);
    248233  recalculateDisplayParameters(w);
    249   setViewForInput(data);
     234  setViewForInput(client_data);
    250235}
    251236
    252237/****   Expose event handling   ****/
    253238
    254 static void handleExpose (w, data, area)
    255         Widget  w;
    256         void *  data;
    257         Region  area;
     239static void handleExpose (Widget w,
     240        XtPointer  client_data __attribute__((unused)),
     241        XtPointer call_data)
    258242{
    259243  XRectangle bbox;
    260244 
     245  Region  area = call_data;
    261246  XClipBox(area, &bbox);
    262247  redrawValues(w, bbox.x, bbox.y, bbox.width, bbox.height);
    263248}
    264249
    265 static void redrawValues (w, left, top, width, height)
    266         Widget          w;
    267         Position        left;
    268         Position        top;
    269         Dimension       width;
    270         Dimension       height;
     250static void redrawValues (Widget        w,
     251        Position        left,
     252        Position        top,
     253        Dimension       width,
     254        Dimension       height)
    271255{
    272256  TextViewData * data;
    273257  int   x, y;
     
    331315#define XIndex(x) (((x) + data->xOffset) / data->cellWidth)
    332316#define YIndex(y) (((y) + data->yOffset) / data->cellHeight)
    333317
    334 static void scrollHorizontal (w, data, x)
    335         Widget          w;
    336         TextViewData *  data;
    337         int             x;
     318static void scrollHorizontal (Widget w __attribute__((unused)),
     319        XtPointer       client_data,
     320        XtPointer       call_data)
    338321{
    339322  Widget    canvas;
    340323  Dimension width, height;
     
    343326  XPoint    index1, index2;
    344327  GridPoint grid1, grid2;
    345328
     329  TextViewData *data = client_data;
     330  int           x = (int)call_data;
     331
    346332  canvas = data->canvas;
    347333  width  = XtWidth(canvas);
    348334  height = XtHeight(canvas);
     
    377363  setMessageLine(msg);
    378364}
    379365
    380 static void scrollVertical (w, data, y)
    381         Widget          w;
    382         TextViewData *  data;
    383         int             y;
     366static void scrollVertical (Widget      w __attribute__((unused)),
     367        XtPointer       client_data,
     368        XtPointer       call_data)
    384369{
    385370  Widget    canvas;
    386371  Dimension width, height;
     
    389374  XPoint    index1, index2;
    390375  GridPoint grid1, grid2;
    391376
     377  TextViewData *data = client_data;
     378  int           y = (int)call_data;
     379
    392380  canvas = data->canvas;
    393381  width  = XtWidth(canvas);
    394382  height = XtHeight(canvas);
     
    429417
    430418/****   Event handling  ****/
    431419
    432 static void highlightCell (w, data, cell)
    433         Widget          w;
    434         TextViewData *  data;
    435         CellInfo *      cell;
     420static void highlightCell (Widget               w,
     421                           TextViewData *       data,
     422                           CellInfo *   cell)
    436423{
    437424  XDrawRectangle(XtDisplay(w), XtWindow(w), data->valueGC,
    438425        cell->bounds.x + 1, cell->bounds.y + 1,
    439426        cell->bounds.width - 2, cell->bounds.height - 2);
    440427}
    441428
    442 static void lowlightCell (w, cell)
    443         Widget          w;
    444         CellInfo *      cell;
     429static void lowlightCell (Widget                w,
     430                          CellInfo *    cell)
    445431{
    446432  redrawValues(w, cell->bounds.x, cell->bounds.y,
    447433                cell->bounds.width, cell->bounds.height);
    448434}
    449435
    450 static void CursorMovement (w, event, params, nparams)
    451         Widget          w;
    452         XEvent *        event;
    453         String *        params;
    454         Cardinal *      nparams;
     436static void CursorMovement (Widget      w,
     437                            XEvent *    event,
     438                            String *    params __attribute__((unused)),
     439                            Cardinal *  nparams __attribute__((unused)))
    455440{
    456441  TextViewData * data;
    457442  char      msg[256];
     
    480465}
    481466
    482467
    483 static void ClearMessage (w, event, params, nparams)
    484         Widget          w;
    485         XEvent *        event;
    486         String *        params;
    487         Cardinal *      nparams;
     468static void ClearMessage (Widget        w,
     469                          XEvent *      event __attribute__((unused)),
     470                          String *      params __attribute__((unused)),
     471                          Cardinal *    nparams __attribute__((unused)))
    488472{
    489473  lowlightCell(w, &cellUnderMouse);
    490474  setMessageLine("");
    491475}
    492476
    493 static void SelectValue (w, event, params, nparams)
    494         Widget          w;
    495         XEvent *        event;
    496         String *        params;
    497         Cardinal *      nparams;
     477static void SelectValue (Widget         w __attribute__((unused)),
     478                         XEvent *       event __attribute__((unused)),
     479                         String *       params __attribute__((unused)),
     480                         Cardinal *     nparams __attribute__((unused)))
    498481{
    499482  /* All the actual input is handled in textInput.c */
    500483  setInputSelection(cellUnderMouse.index.x, cellUnderMouse.index.y);
    501484}
    502 
  • src/xgrid/xgrid_textView.h

    old new  
    4545#endif
    4646#define XtCPrecision    "Precision"
    4747
    48 extern Widget createTextView ();
    49                 /* String name, Widget parent, Arg args[], int nargs */
     48extern Widget createTextView (String name, Widget parent, Arg args[], int nargs);
    5049
    51 extern void setTextViewGrid ();
    52                 /* Widget view, Grid * grid */
     50extern void setTextViewGrid (Widget view, Grid * grid);
    5351
    54 extern void recalculateDisplayParameters ();
    55                 /* Widget view */
     52extern void recalculateDisplayParameters (Widget view);
    5653
    57 extern void redrawGridValue ();
    58                 /* Widget view, int col, int row */
     54extern void redrawGridValue (Widget view, int col, int row);
    5955#endif
    60 
  • src/xgrid/xgrid_utility.c

    old new  
    66
    77#include "xgrid_utility.h"
    88
    9 FILE * CheckOpen (fileName, access)
    10         String fileName;
    11         String access;
     9FILE * CheckOpen (String fileName, String access)
    1210{
    1311  FILE * result;
    14   char   msg[256];
     12  char msg[256];
    1513 
    1614  result = fopen(fileName, access);
    1715  if (result == NULL) {
     
    2119  return result;
    2220}
    2321
    24 void CheckReadLine (file, line, maxLength)
    25         FILE * file;
    26         char   line[];
    27         int    maxLength;
     22void CheckReadLine (FILE *file, char line[], int maxLength)
    2823{
    2924  char * result;
    3025 
     
    3328    XtError("Null returned by fgets");
    3429}
    3530
    36 void Trace (message)
    37         String message;
    38 {
     31void Trace (String message) {
    3932  fprintf(stderr, "%s\n", message);
    4033  fflush(stderr);
    4134}
    42 
  • src/xgrid/xgrid_utility.h

    old new  
    1212#define RoundUp(n, unit) ((((n) + (unit) - 1) / (unit)) * (unit))
    1313#define RoundDown(n, unit) (((n) / (unit)) * (unit))
    1414
    15 extern FILE * CheckOpen ();
    16         /* String fileName, String access */
     15extern FILE * CheckOpen (String fileName, String access);
    1716
    18 extern void CheckReadLine ();
    19         /* FILE * file, char line[], int maxLength */
     17extern void CheckReadLine (FILE * file, char line[], int maxLength);
    2018
    21 extern void Trace ();
    22         /* String message */
     19extern void Trace (String message);
     20
     21#ifndef __GNUC__
     22#define __attribute__(x)
     23#endif
    2324       
    2425#endif
    2526
  • src/xgrid/xgrid_view.c

    old new  
    3838
    3939/****   Local procedures        ****/
    4040
    41 static void getBaseName (); /* String fileName, String baseName */
    42 static void saveChanges (); /* Widget w, ViewData * view, void * callData */
    43 static void doSave (); /* Widget w, ViewData * view, void * callData */
    44 static void doDiscard (); /* Widget w, ViewData * view, void * callData */
     41static void getBaseName (String fileName, String baseName);
     42static void saveChanges (Widget w, XtPointer view, XtPointer callData);
     43static void doSave (Widget w, XtPointer view, XtPointer callData);
     44static void doDiscard (Widget w, XtPointer view, XtPointer callData);
    4545               
    46 static void getBaseName(fileName, baseName)
    47         String fileName;
    48         String baseName;
     46static void getBaseName (String fileName, String baseName)
    4947{
    5048  String slash, stop;
    5149 
     
    6260    *stop = '\0';
    6361}
    6462
    65 Widget createView (fileName, parent, args, nargs)
    66         String fileName;
    67         Widget parent;
    68         Arg    args[];
    69         int    nargs;
     63Widget createView (String fileName,
     64        Widget parent,
     65        Arg args[],
     66        int nargs)
    7067{
    7168  Widget result;
    7269  char   widgetName[255];
     
    7875  strcpy(theView.fileName, fileName);
    7976  theView.grid = CreateGMTGrid();
    8077  Trace("Reading grid file...");
    81   ReadGridFromFile(theView.grid, fileName, &err);
     78  ReadGridFromFile((Grid *)theView.grid, fileName, &err);
    8279  if (err) {
    8380    sprintf(msg, "Unable to read file %s: C error code %d", fileName, err);
    8481    XtError(msg);
     
    109106  return result;
    110107}
    111108
    112 void createFileCommands (parent)
    113         Widget  parent;
     109void createFileCommands (Widget parent)
    114110{
    115111  Widget save;
    116112 
     
    124120/****   When the user quits, be nice and offer to save
    125121        any changes made in a popup dialog      ****/
    126122       
    127 static void saveChanges (w, view, callData)
    128         Widget     w;
    129         ViewData * view;
    130         void *     callData;
     123static void saveChanges (Widget w,
     124        XtPointer client_data,
     125        XtPointer callData __attribute__((unused)))
    131126{
    132127  Widget        dialog;
    133128  XtAppContext  app;
    134129  XEvent        event;
    135  
     130 
     131  ViewData *view = client_data;
     132
    136133  if (! gridHasChanged)
    137134    return;
    138135   
     
    161158  }
    162159}
    163160
    164 static void doSave (w, view, callData)
    165         Widget     w;
    166         ViewData * view;
    167         void *     callData;
     161static void doSave (Widget w,
     162        XtPointer client_data,
     163        XtPointer callData __attribute__((unused)))
    168164{
    169165  String saveName;
    170166  int    err;
    171167  char   msg[256];
    172168 
     169  ViewData *view = client_data;
     170
    173171  saveName = XawDialogGetValueString(XtParent(w));
    174172  strcpy(view->fileName, saveName);
    175   WriteGridToFile(view->grid, view->fileName, &err);
     173  WriteGridToFile((Grid *)view->grid, view->fileName, &err);
    176174  if (err) {
    177175    sprintf(msg, "Unable to save file %s: C error code %d", saveName, err);
    178176    setMessageLine(msg);
     
    187185  }
    188186}
    189187
    190 static void doDiscard (w, view, callData)
    191         Widget     w;
    192         ViewData * view;
    193         void *     callData;
     188static void doDiscard (Widget w __attribute__((unused)),
     189        XtPointer view __attribute__((unused)),
     190        XtPointer callData __attribute__((unused)))
    194191{
    195192  XtPopdown(saveChangesPopup);
    196193  XtDestroyWidget(saveChangesPopup);
    197194  /* MUST do this, otherwise save dialog loops forever */
    198195  saveChangesPopup = NULL;
    199196}
    200 
    201 
  • src/xgrid/xgrid_view.h

    old new  
    1010        Widget    canvas;
    1111        } ViewData;
    1212
    13 extern Widget   createView ();
    14                 /* String fileName, Widget parent, Arg args[], int nargs */
     13extern Widget   createView (String fileName, Widget parent, Arg args[], int nargs);
    1514
    16 extern void     createFileCommands ();
    17                 /* Widget parent */
     15extern void     createFileCommands (Widget parent);
    1816
    1917/* Anything which changes the grid must set this flag */
    2018
  • src/xyz2grd.c

    old new  
    456456                        float value;
    457457                       
    458458                        grd.node_offset = 0;
    459                         fgets (line, BUFSIZ, fp);
     459                        (void)fgets (line, BUFSIZ, fp);
    460460                        GMT_chop (line);                                        /* Rid the world of CR/LF */
    461461                        if (sscanf (line, "%*s %d", &grd.nx) != 1) {
    462462                                fprintf (stderr, "%s: Error decoding ncols record\n", GMT_program);
    463463                                exit (EXIT_FAILURE);
    464464                        }
    465                         fgets (line, BUFSIZ, fp);
     465                        (void)fgets (line, BUFSIZ, fp);
    466466                        GMT_chop (line);                                        /* Rid the world of CR/LF */
    467467                        if (sscanf (line, "%*s %d", &grd.ny) != 1) {
    468468                                fprintf (stderr, "%s: Error decoding ncols record\n", GMT_program);
    469469                                exit (EXIT_FAILURE);
    470470                        }
    471                         fgets (line, BUFSIZ, fp);       GMT_str_tolower (line);
     471                        (void)fgets (line, BUFSIZ, fp); GMT_str_tolower (line);
    472472                        GMT_chop (line);                                        /* Rid the world of CR/LF */
    473473                        if (sscanf (line, "%*s %lf", &grd.x_min) != 1) {
    474474                                fprintf (stderr, "%s: Error decoding xll record\n", GMT_program);
    475475                                exit (EXIT_FAILURE);
    476476                        }
    477477                        if (!strncmp (line, "xllcorner", (size_t)9)) grd.node_offset = 1;       /* Pixel grid */
    478                         fgets (line, BUFSIZ, fp);       GMT_str_tolower (line);
     478                        (void)fgets (line, BUFSIZ, fp); GMT_str_tolower (line);
    479479                        GMT_chop (line);                                        /* Rid the world of CR/LF */
    480480                        if (sscanf (line, "%*s %lf", &grd.y_min) != 1) {
    481481                                fprintf (stderr, "%s: Error decoding yll record\n", GMT_program);
    482482                                exit (EXIT_FAILURE);
    483483                        }
    484484                        if (!strncmp (line, "yllcorner", (size_t)9)) grd.node_offset = 1;       /* Pixel grid */
    485                         fgets (line, BUFSIZ, fp);
     485                        (void)fgets (line, BUFSIZ, fp);
    486486                        GMT_chop (line);                                        /* Rid the world of CR/LF */
    487487                        if (sscanf (line, "%*s %lf", &grd.x_inc) != 1) {
    488488                                fprintf (stderr, "%s: Error decoding cellsize record\n", GMT_program);
     
    500500
    501501                        a = (float *) GMT_memory (VNULL, (size_t)nm, sizeof (float), GMT_program);
    502502                        if (!Ctrl->E.set) {     /* Only read if not specified in -E */
    503                                 fgets (line, BUFSIZ, fp);
     503                                (void)fgets (line, BUFSIZ, fp);
    504504                                GMT_chop (line);                                        /* Rid the world of CR/LF */
    505505                                if (sscanf (line, "%*s %lf", &Ctrl->E.nodata) != 1) {
    506506                                        fprintf (stderr, "%s: Error decoding nodata_value record\n", GMT_program);
  • src/mgd77/mgd77.c

     
    854854                        case  3:        strcpy (P->Parameters_Surveyed_Code, word);                     break;
    855855                        case  4:        strncpy (P->File_Creation_Year, word, 4);
    856856                                        strncpy (P->File_Creation_Month, &word[4], 2);
    857                                         strncpy (P->File_Creation_Day, &word[6], 4);                    break;
     857                                        strncpy (P->File_Creation_Day, &word[6], 2);                    break;
    858858                        case  5:        strcpy (P->Source_Institution, word);                           break;
    859859                        case  6:        strcpy (P->Country, word);                                      break;
    860860                        case  7:        strcpy (P->Platform_Name, word);                                break;
     
    865865                        case 12:        strcpy (P->Funding, word);                                      break;
    866866                        case 13:        strncpy (P->Survey_Departure_Year, word, 4);
    867867                                        strncpy (P->Survey_Departure_Month, &word[4], 2);
    868                                         strncpy (P->Survey_Departure_Day, &word[6], 4);                 break;
     868                                        strncpy (P->Survey_Departure_Day, &word[6], 2);                 break;
    869869                        case 14:        strcpy (P->Port_of_Departure, word);                            break;
    870870                        case 15:        strncpy (P->Survey_Arrival_Year, word, 4);
    871871                                        strncpy (P->Survey_Arrival_Month, &word[4], 2);
    872                                         strncpy (P->Survey_Arrival_Day, &word[6], 4);                   break;
     872                                        strncpy (P->Survey_Arrival_Day, &word[6], 2);                   break;
    873873                        case 16:        strcpy (P->Port_of_Arrival, word);                              break;
    874874                        case 17:        strcpy (P->Navigation_Instrumentation, word);                   break;
    875875                        case 18:        strcpy (P->Geodetic_Datum_Position_Determination_Method, word); break;