]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Fix compiling refclock_palisade.c
authorMartin Burnicki <burnicki@ntp.org>
Tue, 7 Apr 2020 15:48:25 +0000 (17:48 +0200)
committerMartin Burnicki <burnicki@ntp.org>
Tue, 7 Apr 2020 15:48:25 +0000 (17:48 +0200)
Don't have variable declarations after code.

bk: 5e8ca0c9miRY1RGip2dKqyfK3OAdSQ

ntpd/refclock_palisade.c

index e698d72cc52192cdd5af5b2a4fdce0ed4020587c..cb68255d05b0e320a0408cc527b01d0166335c3c 100644 (file)
@@ -304,13 +304,13 @@ palisade_start (
        int fd;
        char gpsdev[20];
        struct termios tio;
+       u_int speed;
 
        snprintf(gpsdev, sizeof(gpsdev), DEVICE, unit);
 
        /*
         * Open serial port. 
         */
-       u_int speed;
        speed = (CLK_TYPE(peer) == CLK_COPERNICUS) ? SPEED232COP : SPEED232;
        fd = refclock_open(gpsdev, speed, LDISC_RAW);
        if (fd <= 0) {
@@ -941,30 +941,32 @@ TSIP_decode (
                        return 0;
                }
                /* Get date & time from WN & ToW minus offset */
-               TCivilDate cd;
-               TGpsDatum wd;
-               l_fp ugo; /* UTC-GPS offset, negative number */
-               ugo.Ul_i.Xl_i = (int32_t)-GPS_UTC_Offset;
-               ugo.l_uf = 0;
-               wd = gpscal_from_gpsweek((wn % 1024), (int32_t)tow, ugo);
-               gpscal_to_calendar(&cd, &wd);
-               pp->year = cd.year;
-               pp->day = cd.yearday;
-               pp->hour = cd.hour;
-               pp->minute = cd.minute;
-               pp->second = cd.second;
-               pp->nsec = 0;
-               pp->leap = LEAP_NOWARNING;
+               {
+                       TCivilDate cd;
+                       TGpsDatum wd;
+                       l_fp ugo; /* UTC-GPS offset, negative number */
+                       ugo.Ul_i.Xl_i = (int32_t)-GPS_UTC_Offset;
+                       ugo.l_uf = 0;
+                       wd = gpscal_from_gpsweek((wn % 1024), (int32_t)tow, ugo);
+                       gpscal_to_calendar(&cd, &wd);
+                       pp->year = cd.year;
+                       pp->day = cd.yearday;
+                       pp->hour = cd.hour;
+                       pp->minute = cd.minute;
+                       pp->second = cd.second;
+                       pp->nsec = 0;
+                       pp->leap = LEAP_NOWARNING;
 #ifdef DEBUG
-               if (debug > 1)  {
-                       printf("GPS TOW: %ld\n", tow);
-                       printf("GPS WN: %d\n", wn);
-                       printf("GPS UTC-GPS Offset: %d\n", GPS_UTC_Offset);
-                       printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%09ld %02d/%02d/%04d ",
-                              up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, pp->second,
-                              pp->nsec, cd.month, cd.monthday, pp->year);
-               }
+                       if (debug > 1)  {
+                               printf("GPS TOW: %ld\n", tow);
+                               printf("GPS WN: %d\n", wn);
+                               printf("GPS UTC-GPS Offset: %d\n", GPS_UTC_Offset);
+                               printf("TSIP_decode: unit %d: %02X #%d %02d:%02d:%02d.%09ld %02d/%02d/%04d ",
+                                      up->unit, mb(0) & 0xff, event, pp->hour, pp->minute, pp->second,
+                                      pp->nsec, cd.month, cd.monthday, pp->year);
+                       }
 #endif
+               }
                return 1;
        }