add cast to XtCalloc() call
[nedit-bw.git] / smartIndent-remove-statics.patch
blob8c7d2e3144a4da4b3c8c60e95d43fd924cd55e54
1 Subject: smartIndent.c: remove statics
3 By comments in the code, reove static variables.
5 ---
7 source/smartIndent.c | 12 +++---------
8 1 file changed, 3 insertions(+), 9 deletions(-)
10 diff --quilt old/source/smartIndent.c new/source/smartIndent.c
11 --- old/source/smartIndent.c
12 +++ new/source/smartIndent.c
13 @@ -816,12 +816,11 @@ void SmartIndentCB(Widget w, XtPointer c
15 static void executeNewlineMacro(WindowInfo *window, smartIndentCBStruct *cbInfo)
17 windowSmartIndentData *winData =
18 (windowSmartIndentData *)window->smartIndentData;
19 - /* posValue probably shouldn't be static due to re-entrance issues <slobasso> */
20 - static DataValue posValue = {INT_TAG, {0}};
21 + DataValue posValue = {INT_TAG, {0}};
22 DataValue result;
23 RestartData *continuation;
24 char *errMsg;
25 int stat;
27 @@ -887,40 +886,35 @@ Boolean InSmartIndentMacros(WindowInfo *
29 static void executeModMacro(WindowInfo *window,smartIndentCBStruct *cbInfo)
31 windowSmartIndentData *winData =
32 (windowSmartIndentData *)window->smartIndentData;
33 - /* args probably shouldn't be static due to future re-entrance issues <slobasso> */
34 - static DataValue args[2] = {{INT_TAG, {0}}, {STRING_TAG, {0}}};
35 - /* after 5.2 release remove inModCB and use new winData->inModMacro value */
36 - static int inModCB = False;
37 + DataValue args[2] = {{INT_TAG, {0}}, {STRING_TAG, {0}}};
38 DataValue result;
39 RestartData *continuation;
40 char *errMsg;
41 int stat;
43 /* Check for inappropriate calls and prevent re-entering if the macro
44 makes a buffer modification */
45 - if (winData == NULL || winData->modMacro == NULL || inModCB)
46 + if (winData == NULL || winData->modMacro == NULL || winData->inModMacro)
47 return;
49 /* Call modification macro with the position of the modification,
50 and the character(s) inserted. Don't allow
51 preemption or time limit. Execution must not overlap or re-enter */
52 args[0].val.n = cbInfo->pos;
53 AllocNStringCpy(&args[1].val.str, cbInfo->charsTyped);
55 - inModCB = True;
56 ++(winData->inModMacro);
58 stat = ExecuteMacro(window, winData->modMacro, 2, args, &result,
59 &continuation, &errMsg);
60 while (stat == MACRO_TIME_LIMIT)
61 stat = ContinueMacro(continuation, &result, &errMsg);
63 --(winData->inModMacro);
64 - inModCB = False;
66 /* Process errors in macro execution */
67 if (stat == MACRO_PREEMPT || stat == MACRO_ERROR)
69 DialogF(DF_ERR, window->shell, 1, "Smart Indent",