mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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:
parent
42f32671a8
commit
e80a6822d5
2 changed files with 270 additions and 263 deletions
19
parse-xml.c
19
parse-xml.c
|
@ -97,7 +97,8 @@ static int match(const char *pattern, int plen,
|
||||||
matchfn_t fn, char *buf, void *data)
|
matchfn_t fn, char *buf, void *data)
|
||||||
{
|
{
|
||||||
switch (name[plen]) {
|
switch (name[plen]) {
|
||||||
case '\0': case '.':
|
case '\0':
|
||||||
|
case '.':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -161,7 +162,9 @@ static void divedate(char *buffer, void *_when)
|
||||||
int hh, mm, ss;
|
int hh, mm, ss;
|
||||||
timestamp_t *when = _when;
|
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) {
|
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 */
|
/* 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) {
|
} 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)
|
static void divetags(char *buffer, void *_tags)
|
||||||
{
|
{
|
||||||
struct tag_entry *tags = _tags;
|
struct tag_entry *tags = _tags;
|
||||||
|
@ -963,9 +969,11 @@ success:
|
||||||
|
|
||||||
#define uddf_datedata(name, offset) \
|
#define uddf_datedata(name, offset) \
|
||||||
static void uddf_##name(char *buffer, void *_when) \
|
static void uddf_##name(char *buffer, void *_when) \
|
||||||
{ timestamp_t *when = _when; \
|
{ \
|
||||||
|
timestamp_t *when = _when; \
|
||||||
cur_tm.tm_##name = atoi(buffer) + offset; \
|
cur_tm.tm_##name = atoi(buffer) + offset; \
|
||||||
*when = utc_mktime(&cur_tm); }
|
*when = utc_mktime(&cur_tm); \
|
||||||
|
}
|
||||||
|
|
||||||
uddf_datedata(year, 0)
|
uddf_datedata(year, 0)
|
||||||
uddf_datedata(mon, -1)
|
uddf_datedata(mon, -1)
|
||||||
|
@ -1534,7 +1542,6 @@ static struct nesting {
|
||||||
/* Import type recognition */
|
/* Import type recognition */
|
||||||
{ "Divinglog", DivingLog_importer },
|
{ "Divinglog", DivingLog_importer },
|
||||||
{ "uddf", uddf_importer },
|
{ "uddf", uddf_importer },
|
||||||
|
|
||||||
{ NULL, }
|
{ NULL, }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,8 @@ static void quote(struct membuffer *b, const char *text, int is_attribute)
|
||||||
escape = NULL;
|
escape = NULL;
|
||||||
break;
|
break;
|
||||||
case 1 ... 8:
|
case 1 ... 8:
|
||||||
case 11: case 12:
|
case 11:
|
||||||
|
case 12:
|
||||||
case 14 ... 31:
|
case 14 ... 31:
|
||||||
escape = "?";
|
escape = "?";
|
||||||
break;
|
break;
|
||||||
|
@ -549,7 +550,6 @@ void save_dives_buffer(struct membuffer *b, const bool select_only)
|
||||||
|
|
||||||
/* save the dives */
|
/* save the dives */
|
||||||
for_each_dive(i, dive) {
|
for_each_dive(i, dive) {
|
||||||
|
|
||||||
if (select_only) {
|
if (select_only) {
|
||||||
|
|
||||||
if (!dive->selected)
|
if (!dive->selected)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue