]> vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

git git / sw / tic2json.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40dad44)
fix STGE output & processing
2023年11月29日 11:09:14 +0000 (12:09 +0100)
2023年11月29日 11:09:14 +0000 (12:09 +0100)

diff --git a/src/tic.c b/src/tic.c
index 5668ce50abca2ac27e82f8c9b2911cabc97b2a03..066bff8664df8910faf6641b78eb50447c7ec0c5 100644 (file)
--- a/src/tic.c
+++ b/src/tic.c
@@ -23,7 +23,6 @@ bool *etiq_en; ///< when non-NULL, a token-indexed array, where the related tok
void make_field(struct tic_field *field, const struct tic_etiquette *etiq, char *horodate, char *data)
{
// args come from the bison stack
- int base;
char *rem;
field->horodate = horodate;
@@ -37,13 +36,12 @@ void make_field(struct tic_field *field, const struct tic_etiquette *etiq, char
field->data.s = data;
return;
case T_HEX:
- base = 16;
+ field->data.i = strtoul(data, &rem, 16);
break;
default:
- base = 10;
+ field->data.i = strtol(data, &rem, 10);
break;
}
- field->data.i = (int)strtol(data, &rem, base);
#ifdef TICV01pme
if (U_SANS == etiq->unittype && *data != '0円' && *rem != '0円') {
diff --git a/src/tic.h b/src/tic.h
index 6ee0f9e3600e64fc9ca221cad980916382aca78d..d08af73af36384de636f66d5e194daa560d9cad7 100644 (file)
--- a/src/tic.h
+++ b/src/tic.h
@@ -77,7 +77,7 @@ struct tic_field {
struct tic_etiquette etiq; ///< the field "etiquette"
union {
char *s;
- int i;
+ long i;
} data; ///< the field data, if any
char *horodate; ///< the field horodate, if any
};
diff --git a/src/tic2json.c b/src/tic2json.c
index 597e0a475f1e5b7163799f6cc817785048a80101..74e2a962df040751234e139f712879df4eb5cf90 100644 (file)
--- a/src/tic2json.c
+++ b/src/tic2json.c
@@ -116,7 +116,7 @@ static const char * tic_units[] = {
};
#ifdef TICV02
-static void print_stge_data(int data)
+static void print_stge_data(long data)
{
const char sep = (tp.optflags & TIC2JSON_OPT_CRFIELD) ? '\n' : ' ';
uint32_t d = (uint32_t)data;
@@ -278,7 +278,7 @@ string:
#endif /* TICV02 */
// fallthrough
default:
- ticprintf("%d", field->data.i);
+ ticprintf("%ld", field->data.i);
break;
}
tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /