parse_timestamp(): specify explicitly where we parse timestamps
Currently, Git's source code represents all timestamps as `unsigned long`. In preparation for using a more appropriate data type, let's introduce a symbol `parse_timestamp` (currently being defined to `strtoul`) where appropriate, so that we can later easily switch to, say, use `strtoull()` instead. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
efac8ac84b
commit
1aeb7e756c
4
tag.c
4
tag.c
@ -110,8 +110,8 @@ static unsigned long parse_tag_date(const char *buf, const char *tail)
|
||||
/* nada */;
|
||||
if (buf >= tail)
|
||||
return 0;
|
||||
/* dateptr < buf && buf[-1] == '\n', so strtoul will stop at buf-1 */
|
||||
return strtoul(dateptr, NULL, 10);
|
||||
/* dateptr < buf && buf[-1] == '\n', so parsing will stop at buf-1 */
|
||||
return parse_timestamp(dateptr, NULL, 10);
|
||||
}
|
||||
|
||||
int parse_tag_buffer(struct tag *item, const void *data, unsigned long size)
|
||||
|
||||
Reference in New Issue
Block a user