diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-05-08 21:15:08 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-05-18 06:41:36 -0400 |
commit | 91f1119528b57f94d178f0cfb12efafd0c90bbc9 (patch) | |
tree | b98c68ebf25eb4c477fa99c2548d2c8a4804a4c0 /src/Create.c | |
parent | 43a65ae23370e0f7fb427e96c6d9037d8fa1af35 (diff) |
fixes cppcheck "style" warnings (mostly variable-scope)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Create.c')
-rw-r--r-- | src/Create.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Create.c b/src/Create.c index f818c0b..527be3d 100644 --- a/src/Create.c +++ b/src/Create.c @@ -267,7 +267,7 @@ xtWidgetAlloc( Cardinal num_typed_args) { Widget widget; - Cardinal wsize, csize = 0; + Cardinal csize = 0; ObjectClassExtension ext; LOCK_PROCESS; @@ -290,7 +290,7 @@ xtWidgetAlloc( (*allocate)(widget_class, &csize, &extra, args, &nargs, typed_args, &ntyped, &widget, NULL); } else { - wsize = widget_class->core_class.widget_size; + Cardinal wsize = widget_class->core_class.widget_size; UNLOCK_PROCESS; if (csize) { if (sizeof(struct {char a; double b;}) != @@ -318,7 +318,6 @@ CompileCallbacks( Widget widget) { CallbackTable offsets; - InternalCallbackList* cl; int i; LOCK_PROCESS; @@ -326,7 +325,7 @@ CompileCallbacks( widget->core.widget_class->core_class.callback_private; for (i = (int)(long) *(offsets++); --i >= 0; offsets++) { - cl = (InternalCallbackList *) + InternalCallbackList* cl = (InternalCallbackList *) ((char *) widget - (*offsets)->xrm_offset - 1); if (*cl) *cl = _XtCompileCallbackList((XtCallbackList) *cl); @@ -351,13 +350,11 @@ xtCreate( { /* need to use strictest alignment rules possible in next two decls. */ double widget_cache[100]; - double constraint_cache[20]; Widget req_widget; XtPointer req_constraints = NULL; Cardinal wsize, csize; Widget widget; XtCacheRef *cache_refs; - Cardinal i; XtCreateHookDataRec call_data; widget = xtWidgetAlloc(widget_class, parent_constraint_class, parent, @@ -392,6 +389,7 @@ xtCreate( /* Convert typed arg list to arg list */ if (typed_args != NULL && num_typed_args > 0) { + Cardinal i; args = (ArgList)ALLOCATE_LOCAL(sizeof(Arg) * num_typed_args); if (args == NULL) _XtAllocError(NULL); for (i = 0; i < num_typed_args; i++) { @@ -414,6 +412,7 @@ xtCreate( (void) memmove ((char *) req_widget, (char *) widget, (size_t) wsize); CallInitialize (XtClass(widget), req_widget, widget, args, num_args); if (parent_constraint_class != NULL) { + double constraint_cache[20]; csize = parent_constraint_class->constraint_class.constraint_size; if (csize) { req_constraints = XtStackAlloc(csize, constraint_cache); |