diff options
author | Tomaz Canabrava <tomaz.canabrava@gmail.com> | 2016-03-07 16:18:50 -0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-07 16:42:26 -0800 |
commit | b77c1d0d955e2aa893100bc12131d775b9b4b26d (patch) | |
tree | 842f2725eb70c935e12991d140faf86c12ee3a38 /subsurface-core | |
parent | 3b782da96017c294770ab71544fd3ceb7ab61630 (diff) | |
download | subsurface-b77c1d0d955e2aa893100bc12131d775b9b4b26d.tar.gz |
Silence warnings in load-git.c
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core')
-rw-r--r-- | subsurface-core/load-git.c | 104 |
1 files changed, 66 insertions, 38 deletions
diff --git a/subsurface-core/load-git.c b/subsurface-core/load-git.c index de7af80bf..cc702f6ae 100644 --- a/subsurface-core/load-git.c +++ b/subsurface-core/load-git.c @@ -172,6 +172,7 @@ extern const char *printGPSCoords(int lat, int lon); static void parse_dive_gps(char *line, struct membuffer *str, void *_dive) { + (void) str; uint32_t uuid; degrees_t latitude = parse_degrees(line, &line); degrees_t longitude = parse_degrees(line, &line); @@ -198,6 +199,7 @@ static void parse_dive_gps(char *line, struct membuffer *str, void *_dive) static void parse_dive_location(char *line, struct membuffer *str, void *_dive) { + (void) line; uint32_t uuid; char *name = get_utf8(str); struct dive *dive = _dive; @@ -221,19 +223,19 @@ static void parse_dive_location(char *line, struct membuffer *str, void *_dive) } static void parse_dive_divemaster(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->divemaster = get_utf8(str); } +{ (void) line; struct dive *dive = _dive; dive->divemaster = get_utf8(str); } static void parse_dive_buddy(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->buddy = get_utf8(str); } +{ (void) line; struct dive *dive = _dive; dive->buddy = get_utf8(str); } static void parse_dive_suit(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->suit = get_utf8(str); } +{ (void) line; struct dive *dive = _dive; dive->suit = get_utf8(str); } static void parse_dive_notes(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->notes = get_utf8(str); } +{ (void) line; struct dive *dive = _dive; dive->notes = get_utf8(str); } static void parse_dive_divesiteid(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->dive_site_uuid = get_hex(line); } +{ (void) str; struct dive *dive = _dive; dive->dive_site_uuid = get_hex(line); } /* * We can have multiple tags in the membuffer. They are separated by @@ -241,6 +243,7 @@ static void parse_dive_divesiteid(char *line, struct membuffer *str, void *_dive */ static void parse_dive_tags(char *line, struct membuffer *str, void *_dive) { + (void) line; struct dive *dive = _dive; const char *tag; int len = str->len; @@ -263,35 +266,40 @@ static void parse_dive_tags(char *line, struct membuffer *str, void *_dive) } static void parse_dive_airtemp(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->airtemp = get_temperature(line); } +{ (void) str; struct dive *dive = _dive; dive->airtemp = get_temperature(line); } static void parse_dive_watertemp(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->watertemp = get_temperature(line); } +{ (void) str; struct dive *dive = _dive; dive->watertemp = get_temperature(line); } static void parse_dive_duration(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->duration = get_duration(line); } +{ (void) str; struct dive *dive = _dive; dive->duration = get_duration(line); } static void parse_dive_rating(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->rating = get_index(line); } +{ (void) str; struct dive *dive = _dive; dive->rating = get_index(line); } static void parse_dive_visibility(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->visibility = get_index(line); } +{ (void) str; struct dive *dive = _dive; dive->visibility = get_index(line); } static void parse_dive_notrip(char *line, struct membuffer *str, void *_dive) -{ struct dive *dive = _dive; dive->tripflag = NO_TRIP; } +{ + (void) str; + (void) line; + struct dive *dive = _dive; dive->tripflag = NO_TRIP; +} static void parse_site_description(char *line, struct membuffer *str, void *_ds) -{ struct dive_site *ds = _ds; ds->description = strdup(mb_cstring(str)); } +{ (void) line; struct dive_site *ds = _ds; ds->description = strdup(mb_cstring(str)); } static void parse_site_name(char *line, struct membuffer *str, void *_ds) -{ struct dive_site *ds = _ds; ds->name = strdup(mb_cstring(str)); } +{ (void) line; struct dive_site *ds = _ds; ds->name = strdup(mb_cstring(str)); } static void parse_site_notes(char *line, struct membuffer *str, void *_ds) -{ struct dive_site *ds = _ds; ds->notes = strdup(mb_cstring(str)); } +{ (void) line; struct dive_site *ds = _ds; ds->notes = strdup(mb_cstring(str)); } extern degrees_t parse_degrees(char *buf, char **end); static void parse_site_gps(char *line, struct membuffer *str, void *_ds) { + (void) str; struct dive_site *ds = _ds; ds->latitude = parse_degrees(line, &line); @@ -626,49 +634,49 @@ static void sample_parser(char *line, struct divecomputer *dc) } static void parse_dc_airtemp(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->airtemp = get_temperature(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->airtemp = get_temperature(line); } static void parse_dc_date(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; update_date(&dc->when, line); } +{ (void) str; struct divecomputer *dc = _dc; update_date(&dc->when, line); } static void parse_dc_deviceid(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->deviceid = get_hex(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->deviceid = get_hex(line); } static void parse_dc_diveid(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->diveid = get_hex(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->diveid = get_hex(line); } static void parse_dc_duration(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->duration = get_duration(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->duration = get_duration(line); } static void parse_dc_dctype(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->divemode = get_dctype(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->divemode = get_dctype(line); } static void parse_dc_maxdepth(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->maxdepth = get_depth(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->maxdepth = get_depth(line); } static void parse_dc_meandepth(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->meandepth = get_depth(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->meandepth = get_depth(line); } static void parse_dc_model(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->model = get_utf8(str); } +{ (void) line; struct divecomputer *dc = _dc; dc->model = get_utf8(str); } static void parse_dc_numberofoxygensensors(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->no_o2sensors = get_index(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->no_o2sensors = get_index(line); } static void parse_dc_surfacepressure(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->surface_pressure = get_pressure(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->surface_pressure = get_pressure(line); } static void parse_dc_salinity(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->salinity = get_salinity(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->salinity = get_salinity(line); } static void parse_dc_surfacetime(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->surfacetime = get_duration(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->surfacetime = get_duration(line); } static void parse_dc_time(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; update_time(&dc->when, line); } +{ (void) str; struct divecomputer *dc = _dc; update_time(&dc->when, line); } static void parse_dc_watertemp(char *line, struct membuffer *str, void *_dc) -{ struct divecomputer *dc = _dc; dc->watertemp = get_temperature(line); } +{ (void) str; struct divecomputer *dc = _dc; dc->watertemp = get_temperature(line); } static void parse_event_keyvalue(void *_event, const char *key, const char *value) { @@ -768,28 +776,37 @@ static void parse_dc_event(char *line, struct membuffer *str, void *_dc) } static void parse_trip_date(char *line, struct membuffer *str, void *_trip) -{ dive_trip_t *trip = _trip; update_date(&trip->when, line); } +{ (void) str; dive_trip_t *trip = _trip; update_date(&trip->when, line); } static void parse_trip_time(char *line, struct membuffer *str, void *_trip) -{ dive_trip_t *trip = _trip; update_time(&trip->when, line); } +{ (void) str; dive_trip_t *trip = _trip; update_time(&trip->when, line); } static void parse_trip_location(char *line, struct membuffer *str, void *_trip) -{ dive_trip_t *trip = _trip; trip->location = get_utf8(str); } +{ (void) line; dive_trip_t *trip = _trip; trip->location = get_utf8(str); } static void parse_trip_notes(char *line, struct membuffer *str, void *_trip) -{ dive_trip_t *trip = _trip; trip->notes = get_utf8(str); } +{ (void) line; dive_trip_t *trip = _trip; trip->notes = get_utf8(str); } static void parse_settings_autogroup(char *line, struct membuffer *str, void *_unused) -{ set_autogroup(1); } +{ + (void) line; + (void) str; + (void) _unused; + set_autogroup(1); +} static void parse_settings_units(char *line, struct membuffer *str, void *unused) { + (void) str; + (void) unused; if (line) set_informational_units(line); } static void parse_settings_userid(char *line, struct membuffer *str, void *_unused) { + (void) str; + (void) _unused; if (line) { set_save_userid_local(true); set_userid(line); @@ -805,6 +822,8 @@ static void parse_settings_userid(char *line, struct membuffer *str, void *_unus */ static void parse_settings_version(char *line, struct membuffer *str, void *_unused) { + (void) str; + (void) _unused; int version = atoi(line); report_datafile_version(version); if (version > DATAFORMAT_VERSION) @@ -813,7 +832,11 @@ static void parse_settings_version(char *line, struct membuffer *str, void *_unu /* The string in the membuffer is the version string of subsurface that saved things, just FYI */ static void parse_settings_subsurface(char *line, struct membuffer *str, void *_unused) -{ } +{ + (void) line; + (void) str; + (void) _unused; +} struct divecomputerid { const char *model; @@ -860,6 +883,7 @@ static void parse_divecomputerid_keyvalue(void *_cid, const char *key, const cha */ static void parse_settings_divecomputerid(char *line, struct membuffer *str, void *_unused) { + (void) _unused; struct divecomputerid id = { mb_cstring(str) }; id.cstr = id.model + strlen(id.model) + 1; @@ -880,12 +904,14 @@ static void parse_settings_divecomputerid(char *line, struct membuffer *str, voi static void parse_picture_filename(char *line, struct membuffer *str, void *_pic) { + (void) line; struct picture *pic = _pic; pic->filename = get_utf8(str); } static void parse_picture_gps(char *line, struct membuffer *str, void *_pic) { + (void) str; struct picture *pic = _pic; pic->latitude = parse_degrees(line, &line); @@ -894,6 +920,7 @@ static void parse_picture_gps(char *line, struct membuffer *str, void *_pic) static void parse_picture_hash(char *line, struct membuffer *str, void *_pic) { + (void) line; struct picture *pic = _pic; pic->hash = get_utf8(str); } @@ -963,6 +990,7 @@ static struct keyword_action settings_action[] = { static void settings_parser(char *line, struct membuffer *str, void *_unused) { + (void) _unused; match_action(line, str, NULL, settings_action, ARRAY_SIZE(settings_action)); } @@ -1288,6 +1316,8 @@ static int dive_directory(const char *root, const char *name, int timeoff) static int picture_directory(const char *root, const char *name) { + (void) root; + (void) name; if (!active_dive) return GIT_WALK_SKIP; return GIT_WALK_OK; @@ -1424,6 +1454,7 @@ static struct divecomputer *create_new_dc(struct dive *dive) */ static int parse_divecomputer_entry(git_repository *repo, const git_tree_entry *entry, const char *suffix) { + (void) suffix; git_blob *blob = git_tree_entry_blob(repo, entry); if (!blob) @@ -1608,9 +1639,7 @@ void set_git_id(const struct git_oid * id) static int find_commit(git_repository *repo, const char *branch, git_commit **commit_p) { - int ret; git_object *object; - git_tree *tree; if (git_revparse_single(&object, repo, branch)) return report_error("Unable to look up revision '%s'", branch); @@ -1622,7 +1651,6 @@ static int find_commit(git_repository *repo, const char *branch, git_commit **co static int do_git_load(git_repository *repo, const char *branch) { int ret; - git_object *object; git_commit *commit; git_tree *tree; |