File: 03-Type_fixes.patch

package info (click to toggle)
catdoc 1%3A0.95-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,456 kB
  • sloc: ansic: 3,920; sh: 327; tcl: 262; makefile: 188
file content (42 lines) | stat: -rw-r--r-- 1,439 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Description: Use correct types for some on-disk structures.
--- a/src/xlsparse.c
+++ b/src/xlsparse.c
@@ -33,8 +33,8 @@
 void CleanUpFormatIdxUsed(void);
 
 void do_table(FILE *input,char *filename) {    
-	long rectype;
-	long reclen,build_year=0,build_rel=0,offset=0;
+	uint16_t rectype, reclen;
+	uint16_t build_year=0,build_rel=0,offset=0;
 	int eof_flag=0;
 	int itemsread=1;
 	date_shift=25569.0; /* Windows 1900 date system */
@@ -134,7 +135,7 @@
  */
 unsigned char **saved_reference = NULL;
 
-void process_item (int rectype, int reclen, unsigned char *rec) {
+void process_item (uint16_t rectype, uint16_t reclen, unsigned char *rec) {
 	if (rectype != CONTINUE && prev_rectype == SST) {
 		/* we have accumulated  unparsed SST, and now encountered
 		 * another record, which indicates that SST is ended */
--- a/src/xls.h
+++ b/src/xls.h
@@ -9,6 +9,7 @@
 #define XLS_H
 
 #include <stdio.h>
+#include <stdint.h>
 #include <math.h>
 /* types of quoting */
 #define QUOTE_NEVER 0
@@ -34,7 +35,7 @@
 char *format_rk(unsigned char *rec,short int format_code);
 char *gettypename(long rectype);
 void parse_sst(unsigned char *sstbuf,int bufsize);
-void process_item (int rectype, int reclen, unsigned char *rec); 
+void process_item (uint16_t rectype, uint16_t reclen, unsigned char *rec);
 unsigned char **allocate(int row,int col);
 unsigned char *copy_unicode_string(unsigned char **src);
 char convert8to8(char *src,int count);