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
  
43
  
44
  
45
  
46
  
47
  
48
  
49
  
50
  
51
  
52
  
53
  
54
  
55
  
56
  
57
  
58
  
59
  
60
  
61
  
62
  
63
  
64
  
65
  
66
  
67
  
68
  
69
  
70
  
71
  
72
  
73
  
74
  
75
  
76
  
77
  
78
  
79
  
80
  
81
  
82
  
83
  
84
  
85
  
86
  
87
  
88
  
89
  
90
  
91
  
92
  
93
  
94
  
95
  
96
  
97
  
98
  
99
  
100
  
101
  
102
  
103
  
104
  
105
  
106
  
107
  
108
  
109
  
110
  
111
  
112
  
113
  
114
  
115
  
116
  
117
  
118
  
119
  
120
  
121
  
122
  
123
  
124
  
125
  
126
  
127
  
128
  
129
  
130
  
131
  
132
  
133
  
134
  
135
  
136
  
137
  
138
  
139
  
140
  
141
  
142
  
143
  
144
  
145
  
146
  
147
  
148
  
149
  
150
  
151
  
152
  
153
  
154
  
155
  
156
  
157
  
158
  
159
  
160
  
161
  
162
  
163
  
164
  
165
  
166
  
167
  
168
  
/* 
 * $Id$ 
 * 
 * Coverity modeling file. 
 * 
 * Upload to https://scan.coverity.com/projects/1452?tab=analysis_settings . 
 * 
 * Notes: 
 *   * This file may not include any header files, so any derived 
 *     or symbolic types must be defined here. 
 * 
 *   * Full structs and unions are only needed if the fields are accessed. 
 * 
 *   * Uninitialized variables have any value. 
 * 
 * Henrik Grubbström 2015-04-21. 
 */ 
 
/* 
 * Typedefs and constants. 
 */ 
 
#define NULL  0 
#define INT32 int 
 
typedef unsigned int socklen_t; 
 
/* 
 * STDC 
 */ 
 
/* 
 * POSIX 
 */ 
 
/* This function doesn't have a model by default. */ 
 
const char *inet_ntop(int af, const void *src, char *dst, socklen_t size) 
{ 
  int may_fail; 
  char first, last; 
  __coverity_negative_sink__(size); 
  if (!src) 
    return NULL; 
  if (may_fail) 
    return NULL; 
  dst[0] = first; 
  dst[size-1] = first; 
  __coverity_writeall__(dst); 
  return dst; 
} 
 
/* 
 * Pike 
 */ 
 
/* 
 * Modules 
 */ 
 
/* 
 * Image 
 */ 
 
#define COLORTYPE unsigned char 
 
typedef struct rgb_group_struct 
{ 
   COLORTYPE r,g,b; 
/*   COLORTYPE __padding_dont_use__;*/ 
} rgb_group; 
 
/* Due to use of function pointers, Coverity doesn't see the assignments 
 * in these colortable.c functions. 
 */ 
 
#define COLORTABLE_NCTLU_CONVERT(NAME, NCTLU_DESTINATION)             \ 
  void NAME(rgb_group *s, NCTLU_DESTINATION *d, int n,                  \ 
            struct neo_colortable *nct, struct nct_dither *dith,        \ 
            int rowlen)                                                 \ 
  {                                                                     \ 
    NCTLU_DESTINATION first, last;                                      \ 
    d[0] = first;                                                       \ 
    d[n-1] = last;                                                      \ 
    __coverity_writeall__(d);                                           \ 
  } 
 
COLORTABLE_NCTLU_CONVERT(_img_nct_map_to_flat_cubicles, rgb_group); 
COLORTABLE_NCTLU_CONVERT(_img_nct_map_to_flat_full, rgb_group); 
COLORTABLE_NCTLU_CONVERT(_img_nct_map_to_cube, rgb_group); 
COLORTABLE_NCTLU_CONVERT(_img_nct_map_to_flat_rigid, rgb_group); 
 
int image_colortable_map_image(struct neo_colortable *nct, 
                               rgb_group *s, 
                               rgb_group *d, 
                               int len, 
                               int rowlen) 
{ 
  rgb_group first, last; 
  int maybe; 
  if (maybe) return 0; 
  d[0] = first; 
  d[len-1] = last; 
  __coverity_writeall__(d); 
  return 1; 
} 
 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_8bit_flat_cubicles, unsigned char); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_8bit_flat_full, unsigned char); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_8bit_cube, unsigned char); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_8bit_flat_rigid, unsigned char); 
 
int image_colortable_index_8bit_image(struct neo_colortable *nct, 
                                      rgb_group *s, 
                                      unsigned char *d, 
                                      int len, 
                                      int rowlen) 
{ 
  unsigned char first, last; 
  int maybe; 
  if (maybe) return 0; 
  d[0] = first; 
  d[len-1] = last; 
  __coverity_writeall__(d); 
  return 1; 
} 
 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_16bit_flat_cubicles, unsigned short); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_16bit_flat_full, unsigned short); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_16bit_cube, unsigned short); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_16bit_flat_rigid, unsigned short); 
 
int image_colortable_index_16bit_image(struct neo_colortable *nct, 
                                       rgb_group *s, 
                                       unsigned short *d, 
                                       int len, 
                                       int rowlen) 
{ 
  unsigned short first, last; 
  int maybe; 
  if (maybe) return 0; 
  d[0] = first; 
  d[len-1] = last; 
  __coverity_writeall__(d); 
  return 1; 
} 
 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_32bit_flat_cubicles, unsigned INT32); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_32bit_flat_full, unsigned INT32); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_32bit_cube, unsigned INT32); 
COLORTABLE_NCTLU_CONVERT(_img_nct_index_32bit_flat_rigid, unsigned INT32); 
 
int image_colortable_index_32bit_image(struct neo_colortable *nct, 
                                       rgb_group *s, 
                                       unsigned INT32 *d, 
                                       int len, 
                                       int rowlen) 
{ 
  unsigned INT32 first, last; 
  int maybe; 
  if (maybe) return 0; 
  d[0] = first; 
  d[len-1] = last; 
  __coverity_writeall__(d); 
  return 1; 
}