From: oetiker Date: Mon, 11 Jan 2010 09:09:42 +0000 (+0000) Subject: must use int for a proper for to the freebsd 32 time_t issue X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6191f3d1bebe15bc4e446efaa456d4262946efa3;p=rrdtool-all.git must use int for a proper for to the freebsd 32 time_t issue git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.3@1998 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_restore.c b/program/src/rrd_restore.c index cefdfaea..97164acf 100644 --- a/program/src/rrd_restore.c +++ b/program/src/rrd_restore.c @@ -92,18 +92,18 @@ static int get_string_from_node( return (0); } /* int get_string_from_node */ -static int get_long_from_node( +static int get_int_from_node( xmlDoc * doc, xmlNode * node, - long *value) + int *value) { - long temp; + int temp; char *str_ptr; char *end_ptr; str_ptr = (char *) xmlNodeListGetString(doc, node->xmlChildrenNode, 1); if (str_ptr == NULL) { - rrd_set_error("get_long_from_node: xmlNodeListGetString failed."); + rrd_set_error("get_int_from_node: xmlNodeListGetString failed."); return (-1); } @@ -111,7 +111,7 @@ static int get_long_from_node( temp = strtol(str_ptr, &end_ptr, 0); if (str_ptr == end_ptr) { - rrd_set_error("get_long_from_node: Cannot parse buffer as long: %s", + rrd_set_error("get_int_from_node: Cannot parse buffer as long: %s", str_ptr); xmlFree(str_ptr); return (-1); @@ -120,7 +120,7 @@ static int get_long_from_node( *value = temp; return (0); -} /* int get_long_from_node */ +} /* int get_int_from_node */ static int get_ulong_from_node( xmlDoc * doc, @@ -961,7 +961,7 @@ static int parse_tag_rrd( &rrd->stat_head->pdp_step); else if (xmlStrcmp(child->name, (const xmlChar *) "lastupdate") == 0) { if (sizeof(time_t) == sizeof(int)) { - status = get_long_from_node(doc, child, (long *)&rrd->live_head->last_up); + status = get_int_from_node(doc, child, (int *)&rrd->live_head->last_up); } else { if (sizeof(time_t) == sizeof(long long)) { status = get_llong_from_node(doc, child, (long long *)&rrd->live_head->last_up);