Whitespace cleanup for parse-xml.c and save-xml.c

This is looking really good. Done using our whitespace tool.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-02-16 15:42:56 -08:00
parent 42f32671a8
commit e80a6822d5
2 changed files with 270 additions and 263 deletions

View file

@ -97,7 +97,8 @@ static int match(const char *pattern, int plen,
matchfn_t fn, char *buf, void *data)
{
switch (name[plen]) {
case '\0': case '.':
case '\0':
case '.':
break;
default:
return 0;
@ -161,7 +162,9 @@ static void divedate(char *buffer, void *_when)
int hh, mm, ss;
timestamp_t *when = _when;
hh = 0; mm = 0; ss = 0;
hh = 0;
mm = 0;
ss = 0;
if (sscanf(buffer, "%d.%d.%d %d:%d:%d", &d, &m, &y, &hh, &mm, &ss) >= 3) {
/* This is ok, and we got at least the date */
} else if (sscanf(buffer, "%d-%d-%d %d:%d:%d", &y, &m, &d, &hh, &mm, &ss) >= 3) {
@ -212,7 +215,10 @@ static void divedatetime(char *buffer, void *_when)
}
}
enum ParseState {FINDSTART, FINDEND};
enum ParseState {
FINDSTART,
FINDEND
};
static void divetags(char *buffer, void *_tags)
{
struct tag_entry *tags = _tags;
@ -963,9 +969,11 @@ success:
#define uddf_datedata(name, offset) \
static void uddf_##name(char *buffer, void *_when) \
{ timestamp_t *when = _when; \
{ \
timestamp_t *when = _when; \
cur_tm.tm_##name = atoi(buffer) + offset; \
*when = utc_mktime(&cur_tm); }
*when = utc_mktime(&cur_tm); \
}
uddf_datedata(year, 0)
uddf_datedata(mon, -1)
@ -1534,7 +1542,6 @@ static struct nesting {
/* Import type recognition */
{ "Divinglog", DivingLog_importer },
{ "uddf", uddf_importer },
{ NULL, }
};

View file

@ -34,7 +34,8 @@ static void quote(struct membuffer *b, const char *text, int is_attribute)
escape = NULL;
break;
case 1 ... 8:
case 11: case 12:
case 11:
case 12:
case 14 ... 31:
escape = "?";
break;
@ -549,7 +550,6 @@ void save_dives_buffer(struct membuffer *b, const bool select_only)
/* save the dives */
for_each_dive(i, dive) {
if (select_only) {
if (!dive->selected)