Skip to content

Commit

Permalink
kernel: remove unused NewFunctionCT
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Jan 22, 2019
1 parent fde3151 commit 4e55705
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 44 deletions.
7 changes: 3 additions & 4 deletions doc/dev/kernel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -682,9 +682,9 @@ function bag. This is needed so that it can be identified when loading a
saved workspace. <A>cookie</A> should be a unique &C; string, identifying the
handler.
<P/>
To create a function object, there are four functions
<C>NewFunction</C>, <C>NewFunctionC</C>, <C>NewFunctionT</C> and
<C>NewFunctionCT</C>, defined in the file <File>calls.c</File>.
To create a function object, there are three functions
<C>NewFunction</C>, <C>NewFunctionC</C>, and <C>NewFunctionT</C>,
defined in the file <File>calls.c</File>.
<P/>
<C>NewFunction( name, narg, nams, hdlr )</C>
creates and returns a new function. <A>name</A> must be a &GAP;
Expand All @@ -699,7 +699,6 @@ but expects <A>name</A> and <A>nams</A> as &C; strings.
<C>NewFunctionT</C> also does the same as <C>NewFunction</C>,
but has two extra arguments that allow to specify the
<A>type</A> and <A>size</A> of the newly created bag.
<C>NewFunctionCT</C> is a combination of both variations.
<P/>
For example, you can make a function object using the code like:
<Listing>
Expand Down
28 changes: 1 addition & 27 deletions src/calls.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ Obj NewFunctionC (
const Char * nams,
ObjFunc hdlr )
{
return NewFunctionCT( T_FUNCTION, sizeof(FuncBag), name, narg, nams, hdlr );
return NewFunction(MakeImmString(name), narg, ArgStringToList(nams), hdlr);
}


Expand Down Expand Up @@ -976,33 +976,7 @@ Obj NewFunctionT (
/* return the function bag */
return func;
}


/****************************************************************************
**
*F NewFunctionCT( <type>, <size>, <name>, <narg>, <nams>, <hdlr> )
**
** 'NewFunctionCT' does the same as 'NewFunction', but expects <name> and
** <nams> as C strings, and allows to specify the <type> and <size> of the
** newly created bag.
*/
Obj NewFunctionCT (
UInt type,
UInt size,
const Char * name_c,
Int narg,
const Char * nams_c,
ObjFunc hdlr )
{
Obj name_o; /* name as an object */

/* convert the name to an object */
name_o = MakeImmString(name_c);

/* make the function */
return NewFunctionT( type, size, name_o, narg, ArgStringToList( nams_c ), hdlr );
}


/****************************************************************************
**
Expand Down
13 changes: 0 additions & 13 deletions src/calls.h
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,6 @@ extern void CheckAllHandlers(void);
*F NewFunction( <name>, <narg>, <nams>, <hdlr> ) . . . make a new function
*F NewFunctionC( <name>, <narg>, <nams>, <hdlr> ) . . . make a new function
*F NewFunctionT( <type>, <size>, <name>, <narg>, <nams>, <hdlr> )
*F NewFunctionCT( <type>, <size>, <name>, <narg>, <nams>, <hdlr> )
**
** 'NewFunction' creates and returns a new function. <name> must be a GAP
** string containing the name of the function. <narg> must be the number of
Expand All @@ -475,10 +474,6 @@ extern void CheckAllHandlers(void);
**
** 'NewFunctionT' does the same as 'NewFunction', but allows to specify the
** <type> and <size> of the newly created bag.
**
** 'NewFunctionCT' does the same as 'NewFunction', but expects <name> and
** <nams> as C strings, and allows to specify the <type> and <size> of the
** newly created bag.
*/
extern Obj NewFunction (
Obj name,
Expand All @@ -500,14 +495,6 @@ extern Obj NewFunctionT (
Obj nams,
ObjFunc hdlr );

extern Obj NewFunctionCT (
UInt type,
UInt size,
const Char * name,
Int narg,
const Char * nams,
ObjFunc hdlr );


/****************************************************************************
**
Expand Down

0 comments on commit 4e55705

Please sign in to comment.