Skip to content

Commit 9c595b2

Browse files
committed
Extended c89 handling
1 parent 4348518 commit 9c595b2

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,8 @@ c89:
171171
-e 's/INT64_MAX/(mp_i64)(((mp_u64)1<<63)-1)/g' \
172172
-e 's/INT64_MIN/(mp_i64)((mp_u64)1<<63)/g' \
173173
-e 's/SIZE_MAX/((size_t)-1)/g' \
174+
-e 's/\([^u]\)intmax_t/\1__intmax_t/g' \
175+
-e 's/uintmax_t/__uintmax_t/g' \
174176
-e 's/\(PRI[ioux]64\)/MP_\1/g' \
175177
-e 's/uint\([0-9][0-9]*\)_t/mp_u\1/g' \
176178
-e 's/int\([0-9][0-9]*\)_t/mp_i\1/g' \
@@ -195,7 +197,15 @@ c99:
195197
-e 's/(mp_i64)((mp_u64)1<<63)/INT64_MIN/g' \
196198
-e 's/(mp_i64)(((mp_u64)1<<63)-1)/INT64_MAX/g' \
197199
-e 's/((size_t)-1)/SIZE_MAX/g' \
200+
<<<<<<< HEAD
198201
-e 's/MP_\(PRI[ioux]64\)/\1/g' \
202+
||||||| constructed merge base
203+
-e 's/MP_\(PRI[iux]64\)/\1/g' \
204+
=======
205+
-e 's/__intmax_t/intmax_t/g' \
206+
-e 's/__uintmax_t/uintmax_t/g' \
207+
-e 's/MP_\(PRI[iuox]64\)/\1/g' \
208+
>>>>>>> Extended c89 handling
199209
-e 's/mp_u\([0-9][0-9]*\)/uint\1_t/g' \
200210
-e 's/mp_i\([0-9][0-9]*\)/int\1_t/g' \
201211
-e 's/MP_FUNCTION_NAME/__func__/g' \

s_mp_fprintf.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ static int s_mp_print_limb(const mp_digit d, const char *format, int base, bool
165165
#elif defined(MP_64BIT)
166166
switch (base) {
167167
case 8:
168-
/*
169-
its defined in the local inttype.h as
168+
/*
169+
its defined in the local inttype.h as
170170
# if __WORDSIZE == 64
171171
# define __PRI64_PREFIX "l"
172172
# define __PRIPTR_PREFIX "l"
@@ -175,11 +175,11 @@ its defined in the local inttype.h as
175175
# define __PRIPTR_PREFIX
176176
# endif
177177
178-
...
178+
...
179179
180180
# define PRIo64 __PRI64_PREFIX "o"
181181
182-
*/
182+
*/
183183
f = strcat(f, PRIo64);
184184
break;
185185
case 10:
@@ -362,7 +362,7 @@ int s_mp_fprintf(FILE *stream, const char *format, va_list args)
362362
}
363363
break;
364364
case 'j':
365-
printed_characters += fprintf(stream, format_out, va_arg(args, intmax_t));
365+
printed_characters += fprintf(stream, format_out, va_arg(args,intmax_t));
366366
break;
367367
case 't':
368368
printed_characters += fprintf(stream, format_out, va_arg(args, ptrdiff_t));

0 commit comments

Comments
 (0)