Silence warnings in load-git.c

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2016-03-07 16:18:50 -03:00 committed by Dirk Hohndel
parent 3b782da960
commit b77c1d0d95

View file

@ -172,6 +172,7 @@ extern const char *printGPSCoords(int lat, int lon);
static void parse_dive_gps(char *line, struct membuffer *str, void *_dive) static void parse_dive_gps(char *line, struct membuffer *str, void *_dive)
{ {
(void) str;
uint32_t uuid; uint32_t uuid;
degrees_t latitude = parse_degrees(line, &line); degrees_t latitude = parse_degrees(line, &line);
degrees_t longitude = 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) static void parse_dive_location(char *line, struct membuffer *str, void *_dive)
{ {
(void) line;
uint32_t uuid; uint32_t uuid;
char *name = get_utf8(str); char *name = get_utf8(str);
struct dive *dive = _dive; 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) 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) 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) 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) 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) 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 * 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) static void parse_dive_tags(char *line, struct membuffer *str, void *_dive)
{ {
(void) line;
struct dive *dive = _dive; struct dive *dive = _dive;
const char *tag; const char *tag;
int len = str->len; 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) 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) 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) 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) 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) 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) 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) 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) 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) 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); extern degrees_t parse_degrees(char *buf, char **end);
static void parse_site_gps(char *line, struct membuffer *str, void *_ds) static void parse_site_gps(char *line, struct membuffer *str, void *_ds)
{ {
(void) str;
struct dive_site *ds = _ds; struct dive_site *ds = _ds;
ds->latitude = parse_degrees(line, &line); 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) 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) static void parse_settings_units(char *line, struct membuffer *str, void *unused)
{ {
(void) str;
(void) unused;
if (line) if (line)
set_informational_units(line); set_informational_units(line);
} }
static void parse_settings_userid(char *line, struct membuffer *str, void *_unused) static void parse_settings_userid(char *line, struct membuffer *str, void *_unused)
{ {
(void) str;
(void) _unused;
if (line) { if (line) {
set_save_userid_local(true); set_save_userid_local(true);
set_userid(line); 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) static void parse_settings_version(char *line, struct membuffer *str, void *_unused)
{ {
(void) str;
(void) _unused;
int version = atoi(line); int version = atoi(line);
report_datafile_version(version); report_datafile_version(version);
if (version > DATAFORMAT_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 */ /* 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) static void parse_settings_subsurface(char *line, struct membuffer *str, void *_unused)
{ } {
(void) line;
(void) str;
(void) _unused;
}
struct divecomputerid { struct divecomputerid {
const char *model; 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) static void parse_settings_divecomputerid(char *line, struct membuffer *str, void *_unused)
{ {
(void) _unused;
struct divecomputerid id = { mb_cstring(str) }; struct divecomputerid id = { mb_cstring(str) };
id.cstr = id.model + strlen(id.model) + 1; 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) static void parse_picture_filename(char *line, struct membuffer *str, void *_pic)
{ {
(void) line;
struct picture *pic = _pic; struct picture *pic = _pic;
pic->filename = get_utf8(str); pic->filename = get_utf8(str);
} }
static void parse_picture_gps(char *line, struct membuffer *str, void *_pic) static void parse_picture_gps(char *line, struct membuffer *str, void *_pic)
{ {
(void) str;
struct picture *pic = _pic; struct picture *pic = _pic;
pic->latitude = parse_degrees(line, &line); 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) static void parse_picture_hash(char *line, struct membuffer *str, void *_pic)
{ {
(void) line;
struct picture *pic = _pic; struct picture *pic = _pic;
pic->hash = get_utf8(str); 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) static void settings_parser(char *line, struct membuffer *str, void *_unused)
{ {
(void) _unused;
match_action(line, str, NULL, settings_action, ARRAY_SIZE(settings_action)); 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) static int picture_directory(const char *root, const char *name)
{ {
(void) root;
(void) name;
if (!active_dive) if (!active_dive)
return GIT_WALK_SKIP; return GIT_WALK_SKIP;
return GIT_WALK_OK; 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) 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); git_blob *blob = git_tree_entry_blob(repo, entry);
if (!blob) 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) static int find_commit(git_repository *repo, const char *branch, git_commit **commit_p)
{ {
int ret;
git_object *object; git_object *object;
git_tree *tree;
if (git_revparse_single(&object, repo, branch)) if (git_revparse_single(&object, repo, branch))
return report_error("Unable to look up revision '%s'", 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) static int do_git_load(git_repository *repo, const char *branch)
{ {
int ret; int ret;
git_object *object;
git_commit *commit; git_commit *commit;
git_tree *tree; git_tree *tree;