code-style + no need to zero static variables

This commit is contained in:
Hiltjo Posthuma 2015-08-16 20:09:59 +02:00
parent c4573f3289
commit 29fa81e623
6 changed files with 18 additions and 20 deletions

View File

@ -15,14 +15,12 @@
#include "util.h"
static char *line = NULL;
size_t linesize = 0;
static struct feed **feeds;
static char *line;
static size_t linesize;
static struct utimbuf contenttime;
static time_t comparetime;
static unsigned long totalnew = 0;
static struct feed **feeds = NULL;
static unsigned long totalnew;
/* Unescape / decode fields printed by string_print_encoded()
* "\\" to "\", "\t", to TAB, "\n" to newline. Unrecognised escape sequences

View File

@ -7,11 +7,11 @@
#include "util.h"
static struct feed **feeds = NULL;
static int showsidebar = 0; /* show sidebar ? */
static char *line = NULL;
static size_t linesize = 0;
static unsigned long totalnew = 0;
static struct feed **feeds;
static int showsidebar;
static char *line;
static size_t linesize;
static unsigned long totalnew;
static time_t comparetime;
static void

View File

@ -12,8 +12,8 @@
#include "util.h"
static char *line = NULL;
static size_t linesize = 0;
static char *line;
static size_t linesize;
/* jenkins one-at-a-time hash, used for Message-Id */
static uint32_t

View File

@ -9,8 +9,8 @@
#include "util.h"
static time_t comparetime;
static char *line = NULL;
static size_t size = 0;
static char *line;
static size_t linesize;
/* print `len' columns of characters. If string is shorter pad the rest
* with characters `pad`. */
@ -41,7 +41,7 @@ printfeed(FILE *fp, const char *feedname)
char *fields[FieldLast];
time_t parsedtime;
while (parseline(&line, &size, fields, fp) > 0) {
while (parseline(&line, &linesize, fields, fp) > 0) {
parsedtime = 0;
strtotime(fields[FieldUnixTimestamp], &parsedtime);

View File

@ -81,7 +81,7 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name,
isfeedlink = 1;
strlcpy(feedtype, value, sizeof(feedtype));
}
} else if (!strncasecmp(name, "href", namelen)) {
} else if (!strcasecmp(name, "href")) {
strlcpy(feedlink, value, sizeof(feedlink));
}
}

View File

@ -8,7 +8,7 @@
#include "xml.h"
static XMLParser parser;
static int isxmlpi = 0, tags = 0;
static int isxmlpi, tags;
static void
xmltagstart(XMLParser *p, const char *tag, size_t taglen)
@ -42,7 +42,7 @@ xmlattr(XMLParser *p, const char *tag, size_t taglen, const char *name,
(void)taglen;
(void)valuelen;
if (isxmlpi && (!strncasecmp(name, "encoding", namelen))) {
if (isxmlpi && (!strcasecmp(name, "encoding"))) {
if (*value) {
/* output lowercase */
for (; *value; value++)
@ -57,8 +57,8 @@ int
main(void)
{
parser.xmlattr = xmlattr;
parser.xmltagstart = xmltagstart;
parser.xmltagend = xmltagend;
parser.xmltagstart = xmltagstart;
xml_parse_fd(&parser, 0);