Displaying 9 results from an estimated 9 matches for "strtoint".
Did you mean:
ptrtoint
2016 Jul 18
2
[PATCH] mllib: Getopt: fix integer parsing
...topt-c.c
@@ -30,6 +30,8 @@
#include <error.h>
#include <assert.h>
+#include "xstrtol.h"
+
#include <caml/alloc.h>
#include <caml/fail.h>
#include <caml/memory.h>
@@ -117,6 +119,26 @@ do_call1 (value funv, value paramv)
CAMLreturn0;
}
+static int
+strtoint (const char *arg)
+{
+ long int num;
+
+ if (xstrtol (arg, NULL, 0, &num, NULL) != LONGINT_OK) {
+ fprintf (stderr, _("%s: '%s' is not a numeric value.\n"),
+ guestfs_int_program_name, arg);
+ show_error (EXIT_FAILURE);
+ }
+
+ if (num <= INT_MIN || nu...
2016 Jul 18
0
Re: [PATCH] mllib: Getopt: fix integer parsing
...}
This function needs to return something other than 'int', since on 64
bit OCaml integers (the final destination) are signed 63 bits. I
think returning 'long' is a better idea, and the receiving 'num'
should also be 'long' (as in my patch).
> +static int
> +strtoint (const char *arg)
> +{
> + long int num;
> +
> + if (xstrtol (arg, NULL, 0, &num, NULL) != LONGINT_OK) {
> + fprintf (stderr, _("%s: '%s' is not a numeric value.\n"),
> + guestfs_int_program_name, arg);
> + show_error (EXIT_FAILURE);
&g...
2016 Jul 18
0
[PATCH v3 1/3] mllib: getopt: Further fix int parsing.
...mlvalues.h>.
Fixes commit 66b54bfefe42f2996d1b42c3646511bbd4349317.
---
mllib/getopt-c.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c
index bf40f91..13852c2 100644
--- a/mllib/getopt-c.c
+++ b/mllib/getopt-c.c
@@ -124,13 +124,13 @@ strtoint (const char *arg)
{
long int num;
- if (xstrtol (arg, NULL, 0, &num, NULL) != LONGINT_OK) {
+ if (xstrtol (arg, NULL, 0, &num, "") != LONGINT_OK) {
fprintf (stderr, _("%s: '%s' is not a numeric value.\n"),
guestfs_int_program_name, arg)...
2016 Jul 18
2
Re: [PATCH] mllib: Getopt: fix integer parsing
...o handle values bigger than int
(as in C int, i.e. signed 32 bits) at all -- neither it is actually
needed, nor it would be coherent in 32bit vs 64bit builds.
If we really 64bit values as parameters, then let's just create a new
option type marking that.
>
> > +static int
> > +strtoint (const char *arg)
> > +{
> > + long int num;
> > +
> > + if (xstrtol (arg, NULL, 0, &num, NULL) != LONGINT_OK) {
> > + fprintf (stderr, _("%s: '%s' is not a numeric value.\n"),
> > + guestfs_int_program_name, arg);
> >...
2020 Mar 13
0
Wine release 5.4
...i: Get rid of header files.
winaspi: Build with msvcrt.
kernelbase: Don't use towlower() on the full Unicode character range.
kernelbase: Don't use wcsicmp/wcsnicmp() on the full Unicode character range.
kernelbase: Don't allow the full Unicode character range in StrToInt* functions.
kernelbase: Don't allow the full Unicode character range in path functions.
msvcrt/tests: Add tests for Unicode spaces in wcstol().
ntdll/tests: Remove some workarounds for older Windows versions.
ntdll: Use the NLS case mapping table for towlower/towupper....
2016 Jul 18
4
[PATCH v2 0/3] mllib: Various fixes and changes to Getopt module.
v1 -> v2:
- Further fixes to Getopt int parsing.
- Completed the L/S changes.
- Fixed the test suite so it passes now. Also we don't need the
special-case tests for 64 bit arch.
Rich.
2016 Jul 18
4
[PATCH v3 0/3] mllib: Various fixes and changes to Getopt module.
v2 -> v3:
- Add M variant and test it.
Rich.
2016 Sep 08
4
[PATCH 0/3] Use gnulib's getprogname
Hi,
this series update libguestfs to a recent gnulib version, so that we
can use its new getprogname module, and solve altogether one of the
porting issues (the need for 'program_name' by the error module of
gnulib), and have a single way to get the name of the current program.
A number of changes in tools mostly, although mechanical.
Thanks,
Pino Toscano (3):
Update gnulib to latest
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...error (f_"external command ‘%s’ stopped by signal %d")
(stringify_args args) i
with
| Executable_not_found tool -> 127
diff --git a/mllib/getopt-c.c b/mllib/getopt-c.c
index 8336c3fb5..d2d98768c 100644
--- a/mllib/getopt-c.c
+++ b/mllib/getopt-c.c
@@ -189,7 +189,7 @@ strtoint (const char *arg)
long int num;
if (xstrtol (arg, NULL, 0, &num, "") != LONGINT_OK) {
- fprintf (stderr, _("%s: '%s' is not a numeric value.\n"),
+ fprintf (stderr, _("%s: ‘%s’ is not a numeric value.\n"),
getprogname (), arg);...