Ticket #41226: patch-grdvector.diff

File patch-grdvector.diff, 1.2 KB (added by florian@…, 11 years ago)

Patchfile fixes Mavericks bug

  • src/grdvector.c

     
    388388        if (!Ctrl->N.active) GMT_map_clip_on (GMT_no_rgb, 3);
    389389
    390390        if (Ctrl->I.xinc != 0.0 && Ctrl->I.yinc != 0.0) {       /* Gave a coarser grid spacing, we hope */
    391                 struct GRD_HEADER tmp_h;
    392                 double val;
    393                 tmp_h = h[0];
    394                 tmp_h.x_inc = Ctrl->I.xinc;
    395                 tmp_h.y_inc = Ctrl->I.yinc;
    396                 GMT_RI_prepare (&tmp_h);        /* Convert to make sure we have correct increments */
    397                 Ctrl->I.xinc = tmp_h.x_inc;
    398                 Ctrl->I.yinc = tmp_h.y_inc;
    399                 val = Ctrl->I.yinc / h[0].y_inc;
     391                double val = Ctrl->I.yinc / h[0].y_inc;
    400392                dj = irint (val);
    401393                if (dj == 0 || fabs (val - dj) > GMT_CONV_LIMIT) {
    402394                        fprintf (stderr, "%s: Error: New y grid increment (%g) is not a multiple of actual grid increment (%g).\n", GMT_program, Ctrl->I.xinc, h[0].x_inc);
     
    408400                        fprintf (stderr, "%s: Error: New x grid increment (%g) is not a multiple of actual grid increment (%g).\n", GMT_program, Ctrl->I.xinc, h[0].x_inc);
    409401                        exit (EXIT_FAILURE);
    410402                }
     403                /* Determine starting point for straddled access */
    411404                tmp = ceil (h[0].y_max / Ctrl->I.yinc) * Ctrl->I.yinc;
    412405                if (tmp > h[0].y_max) tmp -= Ctrl->I.yinc;
    413406                j0 = irint ((h[0].y_max - tmp) / h[0].y_inc);