Skip to content

Commit

Permalink
GSTextStorage: Add function prototypes (#249)
Browse files Browse the repository at this point in the history
Add a function prototype for:
- `addImp` (`(void)addObject:(ObjectType)anObject`)
- `insImp` (`(void)insertObject:(ObjectType)anObject atIndex:(NSUInteger)index`)
- `remImp` (`(void)removeObject:(ObjectType)anObject`)
-  cntImp (`count`)

Fixes warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
  • Loading branch information
qmfrederik authored Apr 1, 2024
1 parent 4470a15 commit c50123f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/GSTextStorage.m
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,11 @@ - (id) replacementObjectForPortCoder: (NSPortCoder*)aCoder
static SEL remSel;

static IMP infImp;
static void (*addImp)();
static unsigned (*cntImp)();
static void (*insImp)();
static void (*addImp)(NSMutableArray*, SEL, NSObject*);
static unsigned (*cntImp)(NSMutableArray*, SEL);
static void (*insImp)(NSMutableArray*, SEL, NSObject*, NSUInteger);
static IMP oatImp;
static void (*remImp)();
static void (*remImp)(NSMutableArray*, SEL, NSUInteger);

#define NEWINFO(Z,O,L) ((*infImp)(infCls, infSel, (Z), (O), (L)))
#define ADDOBJECT(O) ((*addImp)(_infoArray, addSel, (O)))
Expand Down

0 comments on commit c50123f

Please sign in to comment.