gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] [PATCH 6/8] Shift JSON_DATE_MAX definition so shared_json


From: Robert Norris
Subject: Re: [gpsd-dev] [PATCH 6/8] Shift JSON_DATE_MAX definition so shared_json.c doesn't need to rely on gpsd.h
Date: Wed, 20 Apr 2016 01:07:53 +0100

I moved the JSON_DATE_MAX to be in an accessible place as code for building 
both (lib)gpsd and libgps requires it.
libgps should not depend on gpsd.h, thus I believe either the definitions 
should go into gps.h or gpsd_config.h (which are platform non specific - 
whereas gpsd.h has terminal definitions not available under Windows).

Since unnecessarily changing gps.h is not good practice, I moved it to 
gpsd_config.h - and since this file is auto generated by scons - I put the 
definition there, even if it never changes.

I suppose one could instead to move these fixed parts to be in a separate file 
(e.g. gpsd_definitions.h) that gets included in gpsd_config.h.

This would also apply to patch 7, where I moved a bunch of definitions into 
gpsd_config.h in a similar manner.

--
Be Seeing You - Rob.
If at first you don't succeed,
then skydiving isn't for you.


----------------------------------------
> Date: Tue, 19 Apr 2016 13:47:06 -0700
> From: address@hidden
> To: address@hidden
> CC: address@hidden
> Subject: Re: [gpsd-dev] [PATCH 6/8] Shift JSON_DATE_MAX definition so 
> shared_json.c doesn't need to rely on gpsd.h
>
> Yo Rob!
>
> Why move JSON_DATE_MAX into Sconstruct? It is defined as a fixed
> constant for one and all in ISO 8601 and thhus not something that
> SConstruct should ever touch.
>
> On Tue, 19 Apr 2016 21:01:43 +0100
> Rob Norris <address@hidden> wrote:
>
>> TESTED:
>> 'scons build-all check' passes.
>> ---
>> SConstruct | 2 ++
>> gpsd.h-tail | 2 --
>> gpsdclient.h | 2 +-
>> shared_json.c | 2 +-
>> 4 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/SConstruct b/SConstruct
>> index 21e04b3..a850c35 100644
>> --- a/SConstruct
>> +++ b/SConstruct
>> @@ -851,6 +851,8 @@ int clock_gettime(clockid_t, struct timespec *);
>> */
>> #define MAX_PACKET_LENGTH 516 /* 7 + 506 + 3 */
>>
>> +#define JSON_DATE_MAX 24 /* ISO8601 timestamp with 2
>> decimal places */ +
>> #define GPSD_CONFIG_H
>> #endif /* GPSD_CONFIG_H */
>> ''')
>> diff --git a/gpsd.h-tail b/gpsd.h-tail
>> index 85990f0..892067a 100644
>> --- a/gpsd.h-tail
>> +++ b/gpsd.h-tail
>> @@ -37,8 +37,6 @@
>> #define GPSD_PROTO_MAJOR_VERSION 3 /* bump on
>> incompatible changes */ #define GPSD_PROTO_MINOR_VERSION
>> 12 /* bump on compatible changes */
>> -#define JSON_DATE_MAX 24 /* ISO8601 timestamp with 2
>> decimal places */ -
>> #ifndef DEFAULT_GPSD_SOCKET
>> #define DEFAULT_GPSD_SOCKET "/var/run/gpsd.sock"
>> #endif
>> diff --git a/gpsdclient.h b/gpsdclient.h
>> index ba1aabf..236d2b3 100644
>> --- a/gpsdclient.h
>> +++ b/gpsdclient.h
>> @@ -41,7 +41,7 @@ extern void gpsd_source_spec(const char *fromstring,
>>
>> char *maidenhead(double n,double e);
>>
>> -/* this needs to match JSON_DATE_MAX in gpsd.h */
>> +/* this needs to match JSON_DATE_MAX in gpsd_config.h */
>> #define CLIENT_DATE_MAX 24
>>
>> #endif /* _GPSDCLIENT_H_ */
>> diff --git a/shared_json.c b/shared_json.c
>> index a158942..67ba2ea 100644
>> --- a/shared_json.c
>> +++ b/shared_json.c
>> @@ -19,7 +19,7 @@ PERMISSIONS
>> #include <stdbool.h>
>> #include <time.h> /* for time_t */
>>
>> -#include "gpsd.h"
>> +#include "libgps.h"
>> #ifdef SOCKET_EXPORT_ENABLE
>> #include "gps_json.h"
>>
>
>
>
>
> RGDS
> GARY
> ---------------------------------------------------------------------------
> Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
> address@hidden Tel:+1 541 382 8588
                                          


reply via email to

[Prev in Thread] Current Thread [Next in Thread]