comparison libnnchat.c @ 95:69f9c46e4a94

Constify.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 20 Jun 2009 01:45:09 +0300
parents 6e47426efb6a
children 218efd2f0641
comparison
equal deleted inserted replaced
94:6e47426efb6a 95:69f9c46e4a94
10 char c; 10 char c;
11 char *ent; 11 char *ent;
12 } html_entity_t; 12 } html_entity_t;
13 13
14 14
15 html_entity_t HTMLEntities[] = { 15 static const html_entity_t HTMLEntities[] = {
16 { '<', "&lt;" }, 16 { '<', "&lt;" },
17 { '>', "&gt;" }, 17 { '>', "&gt;" },
18 }; 18 };
19 19
20 const int numHTMLEntities = (sizeof(HTMLEntities) / sizeof(HTMLEntities[0])); 20 static const int numHTMLEntities = (sizeof(HTMLEntities) / sizeof(HTMLEntities[0]));
21 21
22 22
23 #ifdef __WIN32 23 #ifdef __WIN32
24 const char *hstrerror(int err) 24 const char *hstrerror(int err)
25 { 25 {
351 while (*s) { 351 while (*s) {
352 if (*s == '&') { 352 if (*s == '&') {
353 int i; 353 int i;
354 BOOL found = FALSE; 354 BOOL found = FALSE;
355 for (i = 0; i < numHTMLEntities; i++) { 355 for (i = 0; i < numHTMLEntities; i++) {
356 html_entity_t *ent = &HTMLEntities[i]; 356 const html_entity_t *ent = &HTMLEntities[i];
357 int len = strlen(ent->ent); 357 int len = strlen(ent->ent);
358 if (!strncmp(s, ent->ent, len)) { 358 if (!strncmp(s, ent->ent, len)) {
359 PUSHCHAR(ent->c); 359 PUSHCHAR(ent->c);
360 s += len; 360 s += len;
361 found = TRUE; 361 found = TRUE;