search for: argc

Displaying 20 results from an estimated 4382 matches for "argc".

Did you mean: arg
2007 May 29
0
[1035] trunk/wxruby2/swig/classes/EvtHandler.i: Removed a heap of redundant stuff that''s been #if 0''d for a while
...push(callbacks, func); - - wxObject* userData = new wxRbCallback(func); - wxObjectEventFunction function = - (wxObjectEventFunction )&wxRbCallback::EventThunker; - (cppSelf)->Connect(firstId, lastId, eventType, function, userData); -} - -static VALUE internal_evt_with_id(int argc, VALUE *argv, VALUE self, - wxEventType eventType) -{ - if (argc != 1) - rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); - - int id = NUM2INT(argv[0]); - //printf("evt_with_id(%d) %s\n", id, rb_block_given_p() ? "with block&qu...
2012 Sep 14
1
[PATCH] xenpm: make argument parsing and error handling more consistent
...lich@suse.com> --- a/tools/misc/xenpm.c +++ b/tools/misc/xenpm.c @@ -36,7 +36,7 @@ #define CPUFREQ_TURBO_ENABLED 1 static xc_interface *xc_handle; -static int max_cpu_nr; +static unsigned int max_cpu_nr; /* help message */ void show_help(void) @@ -77,6 +77,33 @@ void help_func(int argc, char *argv[]) show_help(); } +static void parse_cpuid(const char *arg, int *cpuid) +{ + if ( sscanf(arg, "%d", cpuid) != 1 || *cpuid < 0 ) + { + if ( strcasecmp(arg, "all") ) + { + fprintf(stderr, "Invalid CPU identifier: ''...
2007 Jun 12
0
Branch 'as' - 3 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_as_context.c libswfdec/swfdec_as_math.c libswfdec/swfdec_as_native_function.c libswfdec/swfdec_as_number.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c
...t a/libswfdec/swfdec_as_context.c b/libswfdec/swfdec_as_context.c index 5d4435a..a63cf4d 100644 --- a/libswfdec/swfdec_as_context.c +++ b/libswfdec/swfdec_as_context.c @@ -446,8 +446,7 @@ start: SwfdecAsNativeFunction *native = SWFDEC_AS_NATIVE_FUNCTION (frame->function); if (frame->argc >= native->min_args && (native->type == 0 || - (frame->thisp != NULL && - g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type)))) { + g_type_is_a (G_OBJECT_TYPE (frame->thisp), native->type))) { /* FIXME FIXME FIXME: no casting here please...
2007 Mar 06
6
[LLVMdev] alloca & store generation
I am writing a transformation that needs to add a call to a function F() at the beginning of main() with the addresses of argc and argv as parameters to F(). However, the bytecode file I'm transforming has not allocated space on the stack for argc and argv. So, I developed my transformation to change main() from: ----- int main(int %argc, sbyte** %argv){ entry: ... // some use of %argc and %argv ... } --...
2007 Mar 06
0
[LLVMdev] alloca & store generation
After looking at this problem longer, I believe that there is something wrong with the disassembler. When I run my transformation and then disassemble the output, I get bytecode that looks like: ----- int %main(int %argc, sbyte** %argv) { entry: alloca int ; <int*>:0 [#uses=3] alloca sbyte** ; <sbyte***>:0 [#uses=3] store int %argc, int* %0 store sbyte** %argv, sbyte*** %0 call void %F( int* %0, sbyte*** %0, int 1, int 0 ) ----- However...
2006 Nov 12
0
[ wxruby-Bugs-6632 ] Linux crash on NoteBook in bigdemo.rb
...ibgtk-x11-2.0.so.0 #1 0xb7a437c1 in wxNotebook::InsertPage () from lib/wxruby2.so #2 0xb76a1304 in wxBookCtrlBase::AddPage (this=0x8745008, page=0x869a270, text=@0x82296f8, bSelect=true, imageId=0) at /usr/local/include/wx-2.6/wx/bookctrl.h:154 #3 0xb77b9916 in _wrap_wxNotebook_AddPage (argc=4, argv=0xbf81a2b0, self=3043848000) at src/Notebook.cpp:3472 #4 0x08055146 in call_cfunc (func=0xb77b9800 <_wrap_wxNotebook_AddPage>, recv=3043848000, len=0, argc=0, argv=0xbf81a2b0) at eval.c:5654 #5 0x0805d8cb in rb_call0 (klass=3063385500, recv=3043848000, id=11233, oid=1...
2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.
2014 Jan 23
2
[LLVMdev] How to read v3.3 dbg metadata using v3.4 LLVM
...uot;dbg"); if (MDNode *N = instruction.getMetadata(dbgKind)){ DILocation location(N); fileDirectoryName = location.getDirectory(); fileName = location.getFilename(); lineNumber = location.getLineNumber(); columnNumber = location.getColumnNumber(); } [1] int main(int argc, char **argv){ return 0; } [2] define i32 @main(i32 %argc, i8** %argv) #0 { entry: %retval = alloca i32, align 4 %argc.addr = alloca i32, align 4 %argv.addr = alloca i8**, align 8 store i32 0, i32* %retval store i32 %argc, i32* %argc.addr, align 4 call void @llvm.dbg.decla...
2011 Apr 18
7
[PATCH] tools: xl: on create, if debug && !daemonize, wait for domain destroy in the foreground
# HG changeset patch # User Ian Campbell <ian.campbell@citrix.com> # Date 1303143831 -3600 # Node ID 31b98feb0eb6a50fe9e664a31feaa32ad3dac7cc # Parent 05abea47f4dc670974cd513a0e74db54d22eacc9 tools: xl: on create, if debug && !daemonize, wait for domain destroy in the foreground Perhaps this should be a separate option but I find that when I''m debugging xl in the
2007 Nov 14
0
2 commits - libswfdec/swfdec_as_array.c libswfdec/swfdec_asbroadcaster.c libswfdec/swfdec_as_object.c libswfdec/swfdec_as_string.c libswfdec/swfdec_color_as.c libswfdec/swfdec_initialize.as
...me crashes/asserts when this is null diff --git a/libswfdec/swfdec_as_array.c b/libswfdec/swfdec_as_array.c index 4c30399..3c6cde5 100644 --- a/libswfdec/swfdec_as_array.c +++ b/libswfdec/swfdec_as_array.c @@ -589,6 +589,9 @@ swfdec_as_array_join (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc, const char *var, *str, *sep; SwfdecAsValue val; + if (object == NULL) + return; + if (argc > 0) { sep = swfdec_as_value_to_string (cx, &argv[0]); } else { @@ -623,6 +626,9 @@ void swfdec_as_array_toString (SwfdecAsContext *cx, SwfdecAsObject *object, guint argc,...
2011 Aug 07
2
[PATCH] kinit minor checkpatch cleanup
.../name_to_dev.c | 6 +++--- usr/kinit/nfsroot.c | 5 ++--- 5 files changed, 21 insertions(+), 25 deletions(-) diff --git a/usr/kinit/initrd.c b/usr/kinit/initrd.c index 1c3ec56..d2efc59 100644 --- a/usr/kinit/initrd.c +++ b/usr/kinit/initrd.c @@ -122,7 +122,8 @@ static int run_linuxrc(int argc, char *argv[], dev_t root_dev) _exit(255); } else if (pid > 0) { dprintf("kinit: Waiting for linuxrc to complete...\n"); - while (waitpid(pid, NULL, 0) != pid) ; + while (waitpid(pid, NULL, 0) != pid) + ; dprintf("kinit: linuxrc done\n"); } else { return -...
2017 Mar 23
5
[GSoC 2017] Clang-based diff tool project
...diffs fall into. Then try to figure out where things moved by possibly delving deeper into each block that matched something from the diff. Also if any blocks moved to a completely different location, try and figure that out by matching the MD5 of any blocks. For example if you had: int main(int argc, const char **argv) { if (argc > 2) { } switch (argc) { } } You would first make MD5s for the '(' and ')' in the "main" line and for the '{' at the end of the main line, and ending at the end of the code. Now the code looks like: int main(int argc, co...
2014 Jan 24
2
[LLVMdev] How to read v3.3 dbg metadata using v3.4 LLVM
...gt; fileDirectoryName = location.getDirectory(); >> >> fileName = location.getFilename(); >> >> lineNumber = location.getLineNumber(); >> >> columnNumber = location.getColumnNumber(); >> >> } >> [1] >> >> int main(int argc, char **argv){ >> >> return 0; >> >> } >> >> [2] >> >> define i32 @main(i32 %argc, i8** %argv) #0 { >> >> entry: >> >> %retval = alloca i32, align 4 >> >> %argc.addr = alloca i32, align 4 >> >>...
2017 Mar 30
2
[GSoC 2017] Clang-based diff tool project
...re working on turning the infrastructure into a reusable set of components (https://reviews.llvm.org/D23418 <https://reviews.llvm.org/D23418>). > > Raphael hacked together a few lines of code, addressing Greg's proposal based on D23418. > > > r1 r2 > int main(int argc, const char **argv) { > switch (argc) { > } > if (argc > 2) { > return 1; > } > while (false); > int funkyVariable = 1; > funkyVariable++; > } > int main(int argc, const char **argv) { > if (argc > 2) { > return 1; > } > sw...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...ndex 0000000..5a3f685 --- /dev/null +++ b/.x-sc_prohibit_magic_number_exit @@ -0,0 +1,2 @@ +^.*\.java$ +^.*\.pl$ diff --git a/capitests/test-command.c b/capitests/test-command.c index 7a3e64b..e5cdc93 100644 --- a/capitests/test-command.c +++ b/capitests/test-command.c @@ -57,12 +57,12 @@ main (int argc, char *argv[]) printf ("Result11-1\nResult11-2"); } else { fprintf (stderr, "unknown parameter: %s\n", argv[1]); - exit (1); + exit (EXIT_FAILURE); } } else { fprintf (stderr, "missing parameter\n"); - exit (1); + exit (E...
2010 Sep 16
1
[RFC] function to parse string to argc/argv pair
Currently, I'm looking to improve rosh and would like to start using getopt(). I'd like to parse a string obtained by fgets() to be like the argc/argv pair created by __parse_argv but in a way that's more cross-platform (such that it can also be used by .lnx files rather than just COM32) and suitable to use in rosh and lua.c32. I've made a function and inlined a test program for the function. It concatenates all command line argume...
2018 Apr 05
2
[nbdkit PATCH] tests: Skip guestfs tests on CentOS 6
...c | 5 +++++ tests/test-streaming.c | 5 +++++ tests/test-xz.c | 5 +++++ 16 files changed, 82 insertions(+) diff --git a/tests/test-connect.c b/tests/test-connect.c index 32ba79a..06c6163 100644 --- a/tests/test-connect.c +++ b/tests/test-connect.c @@ -62,6 +62,10 @@ main (int argc, char *argv[]) exit (EXIT_FAILURE); } +#ifndef GUESTFS_ADD_DRIVE_OPTS_PROTOCOL + printf ("libguestfs too old to support nbd disk, skipping\n"); + exit (77); +#else r = guestfs_add_drive_opts (g, "", GUESTFS_ADD_DRIVE_OPTS_READONLY, 1,...
2016 May 05
1
[PATCH] tools: improve reporting for option errors (RHBZ#1316041)
...guestmount.c | 13 ++++++++++--- inspector/inspector.c | 12 ++++++++++-- rescue/rescue.c | 12 ++++++++++-- 10 files changed, 87 insertions(+), 22 deletions(-) diff --git a/cat/cat.c b/cat/cat.c index 0370fbd..4d671ca 100644 --- a/cat/cat.c +++ b/cat/cat.c @@ -224,8 +224,11 @@ main (int argc, char *argv[]) CHECK_OPTION_format_consumed; /* User must have specified some drives. */ - if (drvs == NULL) + if (drvs == NULL) { + fprintf (stderr, _("%s: error: you must specify at least one -a or -d option.\n"), + guestfs_int_program_name); usage (EXIT_FA...
2020 Feb 13
0
[PATCH v3 1/1] tools: add '--blocksize' option for C-based tools
...-a option\n" " -c|--connect uri Specify libvirt URI for -d option\n" " -d|--domain guest Add disks from libvirt guest\n" " --format[=raw|..] Force disk format for -a option\n" @@ -116,6 +118,7 @@ main (int argc, char *argv[]) static const char options[] = "a:c:d:P:qvVx"; static const struct option long_options[] = { { "add", 1, 0, 'a' }, + { "blocksize", 2, 0, 0 }, { "connect", 1, 0, 'c' }, { "domain", 1, 0, 'd...
2020 Feb 12
0
[PATCH v2 1/1] tools: add '--blocksize' option for C-based tools
...sector size of the disk for -a option\n" " --help Display brief help\n" " -P nr_threads Use at most nr_threads\n" " -q|--quiet No output, just exit code\n" @@ -119,6 +121,7 @@ main (int argc, char *argv[]) { "connect", 1, 0, 'c' }, { "domain", 1, 0, 'd' }, { "format", 2, 0, 0 }, + { "blocksize", 2, 0, 0 }, { "help", 0, 0, HELP_OPTION }, { "long-options", 0, 0, 0 }, { "quiet...