Skip to content

Commit 7cebada

Browse files
committed
プロトタイプ宣言の記述位置が不正だったため削除
ローカル利用の関数をstaticに変更
1 parent 2a59c8a commit 7cebada

1 file changed

Lines changed: 42 additions & 46 deletions

File tree

libcob/call.c

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@
5656
#include <windows.h>
5757
/* Prototype */
5858
static char * lt_dlerror (void);
59-
void init_call_stack_list (void);
60-
struct call_stack_list
61-
cob_create_call_stack_list (const char *);
62-
void cob_cancel_call_stack_list (struct call_stack_list *);
6359

6460
static HMODULE
6561
lt_dlopen (const char *x)
@@ -285,6 +281,48 @@ lookup (const char *name)
285281
return NULL;
286282
}
287283

284+
static void
285+
init_call_stack_list (void)
286+
{
287+
if (!call_stack_list_head) {
288+
call_stack_list_head = cob_malloc (sizeof (struct call_stack_list));
289+
memset (call_stack_list_head, 0, sizeof (struct call_stack_list));
290+
}
291+
current_call_stack_list = call_stack_list_head;
292+
}
293+
294+
static struct call_stack_list *
295+
cob_create_call_stack_list (char *name)
296+
{
297+
struct call_stack_list *new_list = cob_malloc (sizeof (struct call_stack_list));
298+
memset (new_list, 0, sizeof (struct call_stack_list));
299+
new_list->parent = current_call_stack_list;
300+
new_list->name = cob_malloc (strlen (name) + 1);
301+
strcpy (new_list->name, name);
302+
current_call_stack_list = new_list;
303+
return new_list;
304+
}
305+
306+
static void
307+
cob_cancel_call_stack_list (struct call_stack_list *p)
308+
{
309+
if (!p) {
310+
/*No program*/
311+
return;
312+
}
313+
static cob_field_attr a_2 = {33, 0, 0, 0, NULL};
314+
cob_field f = {strlen (p->name), (unsigned char *) p->name, &a_2};
315+
cob_field_cancel (&f);
316+
if (p->children) {
317+
cob_cancel_call_stack_list (p->children);
318+
}
319+
struct call_stack_list *s = p->sister;
320+
while (s != NULL) {
321+
cob_cancel_call_stack_list (s);
322+
s = s->sister;
323+
}
324+
}
325+
288326
const char *
289327
cob_resolve_error (void)
290328
{
@@ -697,28 +735,6 @@ coblongjmp (struct cobjmp_buf *jbuf)
697735
longjmp (jbuf->cbj_jmp_buf, 1);
698736
}
699737

700-
void
701-
init_call_stack_list ()
702-
{
703-
if (!call_stack_list_head) {
704-
call_stack_list_head = cob_malloc (sizeof (struct call_stack_list));
705-
memset (call_stack_list_head, 0, sizeof (struct call_stack_list));
706-
}
707-
current_call_stack_list = call_stack_list_head;
708-
}
709-
710-
struct call_stack_list *
711-
cob_create_call_stack_list (char *name)
712-
{
713-
struct call_stack_list *new_list = cob_malloc (sizeof (struct call_stack_list));
714-
memset (new_list, 0, sizeof (struct call_stack_list));
715-
new_list->parent = current_call_stack_list;
716-
new_list->name = cob_malloc (strlen (name) + 1);
717-
strcpy (new_list->name, name);
718-
current_call_stack_list = new_list;
719-
return new_list;
720-
}
721-
722738
void
723739
cob_push_call_stack_list (char *name)
724740
{
@@ -761,26 +777,6 @@ cob_pop_call_stack_list ()
761777
current_call_stack_list = current_call_stack_list->parent;
762778
}
763779

764-
void
765-
cob_cancel_call_stack_list (struct call_stack_list *p)
766-
{
767-
if (!p) {
768-
/*No program*/
769-
return;
770-
}
771-
static cob_field_attr a_2 = {33, 0, 0, 0, NULL};
772-
cob_field f = {strlen (p->name), (unsigned char *) p->name, &a_2};
773-
cob_field_cancel (&f);
774-
if (p->children) {
775-
cob_cancel_call_stack_list (p->children);
776-
}
777-
struct call_stack_list *s = p->sister;
778-
while (s != NULL) {
779-
cob_cancel_call_stack_list (s);
780-
s = s->sister;
781-
}
782-
}
783-
784780
void
785781
cob_cancel_all ()
786782
{

0 commit comments

Comments
 (0)