From 1a9bcdf202f062e89bb73aa9b0bfe6e3c9b4d5d9 Mon Sep 17 00:00:00 2001 From: Tatsuya Kinoshita Date: Tue, 30 Mar 2021 20:15:07 +0900 Subject: Treat textlist item number as int instead of short cf. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=838952 --- textlist.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'textlist.h') diff --git a/textlist.h b/textlist.h index f28b199..654adfb 100644 --- a/textlist.h +++ b/textlist.h @@ -2,6 +2,8 @@ #ifndef TEXTLIST_H #define TEXTLIST_H #include "Str.h" +#include +#define GENERAL_LIST_MAX (INT_MAX / 32) /* General doubly linked list */ @@ -14,7 +16,7 @@ typedef struct _listitem { typedef struct _generallist { ListItem *first; ListItem *last; - short nitem; + int nitem; } GeneralList; extern ListItem *newListItem(void *s, ListItem *n, ListItem *p); @@ -36,7 +38,7 @@ typedef struct _textlistitem { typedef struct _textlist { TextListItem *first; TextListItem *last; - short nitem; + int nitem; } TextList; #define newTextList() ((TextList *)newGeneralList()) @@ -50,7 +52,7 @@ typedef struct _textlist { typedef struct _TextLine { Str line; - short pos; + int pos; } TextLine; typedef struct _textlinelistitem { @@ -62,7 +64,7 @@ typedef struct _textlinelistitem { typedef struct _textlinelist { TextLineListItem *first; TextLineListItem *last; - short nitem; + int nitem; } TextLineList; extern TextLine *newTextLine(Str line, int pos); -- cgit v1.2.3