Skip to content

Commit fb5671c

Browse files
committed
ext/exif: make php_tiff_bytes_per_format and other globals const
1 parent 3b56bcb commit fb5671c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

ext/exif/exif.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ static size_t php_strnlen(char* str, size_t maxlen) {
230230
/* }}} */
231231

232232
/* {{{ error messages */
233-
static const char * EXIF_ERROR_FILEEOF = "Unexpected end of file reached";
234-
static const char * EXIF_ERROR_CORRUPT = "File structure corrupted";
235-
static const char * EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached";
236-
static const char * EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined file section";
233+
static const char *const EXIF_ERROR_FILEEOF = "Unexpected end of file reached";
234+
static const char *const EXIF_ERROR_CORRUPT = "File structure corrupted";
235+
static const char *const EXIF_ERROR_THUMBEOF = "Thumbnail goes IFD boundary or end of file reached";
236+
static const char *const EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined file section";
237237

238238
#define EXIF_ERRLOG_FILEEOF(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_FILEEOF);
239239
#define EXIF_ERRLOG_CORRUPT(ImageInfo) exif_error_docref(NULL EXIFERR_CC, ImageInfo, E_WARNING, "%s", EXIF_ERROR_CORRUPT);
@@ -244,7 +244,7 @@ static const char * EXIF_ERROR_FSREALLOC = "Illegal reallocating of undefined fi
244244
/* {{{ format description defines
245245
Describes format descriptor
246246
*/
247-
static int php_tiff_bytes_per_format[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 1};
247+
static const int php_tiff_bytes_per_format[] = {0, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 1};
248248
#define NUM_FORMATS 13
249249

250250
#define TAG_FMT_BYTE 1
@@ -504,8 +504,8 @@ typedef const struct {
504504
char *Desc;
505505
} tag_info_type;
506506

507-
typedef tag_info_type tag_info_array[];
508-
typedef tag_info_type *tag_table_type;
507+
typedef const tag_info_type tag_info_array[];
508+
typedef const tag_info_type *tag_table_type;
509509

510510
#define TAG_TABLE_END \
511511
{TAG_NONE, "No tag value"},\

0 commit comments

Comments
 (0)