summaryrefslogtreecommitdiff
path: root/shmexport.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-01-27 10:44:40 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-01-27 10:44:40 -0500
commit7b0ae083b7ec7afe8c273195c12d075a3c16d13f (patch)
tree9977223f14c8a361a00eefd4206b8566d20c8e78 /shmexport.c
parent321a9bd00b967dc57706601ae9346526d1df7338 (diff)
downloadgpsd-7b0ae083b7ec7afe8c273195c12d075a3c16d13f.tar.gz
Fix clang's only warning in non-test code, about a cast in the shmexport code.
All regression tests pass with both gcc- and clang-built binaries. One clang warning remains in the JSON test code.
Diffstat (limited to 'shmexport.c')
-rw-r--r--shmexport.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/shmexport.c b/shmexport.c
index 981a6ec2..1d9549d9 100644
--- a/shmexport.c
+++ b/shmexport.c
@@ -44,7 +44,7 @@ bool shm_acquire(struct gps_context_t *context)
strerror(errno));
return false;
}
- context->shmexport = (char *)shmat(shmid, 0, 0);
+ context->shmexport = (void *)shmat(shmid, 0, 0);
if ((int)(long)context->shmexport == -1) {
gpsd_report(&context->errout, LOG_ERROR, "shmat failed: %s\n", strerror(errno));
context->shmexport = NULL;
@@ -83,7 +83,7 @@ void shm_update(struct gps_context_t *context, struct gps_data_t *gpsdata)
*/
shared->bookend2 = tick;
memory_barrier();
- memcpy((void *)(context->shmexport + offsetof(struct shmexport_t, gpsdata)),
+ memcpy((void *)((char *)context->shmexport + offsetof(struct shmexport_t, gpsdata)),
(void *)gpsdata,
sizeof(struct gps_data_t));
memory_barrier();