Use "dive->number" instead of "dive->nr". And make the XML match too.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
#define MAX_CYLINDERS (8)
struct dive {
- int nr;
+ int number;
time_t when;
char *location;
char *notes;
gtk_entry_set_text(location, text);
len = 0;
- if (dive->nr)
- len = snprintf(buffer, sizeof(buffer), "%d. ", dive->nr);
+ if (dive->number)
+ len = snprintf(buffer, sizeof(buffer), "%d. ", dive->number);
snprintf(buffer+len, sizeof(buffer)-len, "%s", text);
gtk_label_set_text(GTK_LABEL(locationnote), buffer);
static int divinglog_dive_match(struct dive *dive, const char *name, int len, char *buf)
{
- return MATCH(".id", get_index, &dive->nr) ||
- MATCH(".divedate", divedate, &dive->when) ||
+ return MATCH(".divedate", divedate, &dive->when) ||
MATCH(".entrytime", divetime, &dive->when) ||
MATCH(".depth", depth, &dive->maxdepth) ||
MATCH(".tanksize", cylindersize, &dive->cylinder[0].type.size) ||
break;
}
- if (MATCH(".nr", get_index, &dive->nr))
+ if (MATCH(".number", get_index, &dive->number))
return;
if (MATCH(".date", divedate, &dive->when))
return;
struct tm *tm = gmtime(&dive->when);
fputs("<dive", f);
- if (dive->nr)
- fprintf(f, " nr='%d'", dive->nr);
+ if (dive->number)
+ fprintf(f, " number='%d'", dive->number);
fprintf(f, " date='%04u-%02u-%02u'",
tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
fprintf(f, " time='%02u:%02u:%02u'",