comparison m_option.c @ 19053:75327b24e06f

marks several string parameters as const, as they are not modified inside the function, Patch by Stefan Huehner, stefan AT huehner-org
author reynaldo
date Thu, 13 Jul 2006 05:03:43 +0000
parents a8e681ad7c90
children 5949a654e2d4
comparison
equal deleted inserted replaced
19052:6866e768aef8 19053:75327b24e06f
20 // Don't free for 'production' atm 20 // Don't free for 'production' atm
21 #ifndef MP_DEBUG 21 #ifndef MP_DEBUG
22 //#define NO_FREE 22 //#define NO_FREE
23 #endif 23 #endif
24 24
25 m_option_t* m_option_list_find(m_option_t* list,char* name) { 25 m_option_t* m_option_list_find(m_option_t* list,const char* name) {
26 int i; 26 int i;
27 27
28 for(i = 0 ; list[i].name ; i++) { 28 for(i = 0 ; list[i].name ; i++) {
29 int l = strlen(list[i].name) - 1; 29 int l = strlen(list[i].name) - 1;
30 if((list[i].type->flags & M_OPT_TYPE_ALLOW_WILDCARD) && 30 if((list[i].type->flags & M_OPT_TYPE_ALLOW_WILDCARD) &&
1194 } 1194 }
1195 } 1195 }
1196 return 0; 1196 return 0;
1197 } 1197 }
1198 1198
1199 static int get_obj_param(char* opt_name,char* obj_name, m_struct_t* desc, 1199 static int get_obj_param(const char* opt_name,const char* obj_name, m_struct_t* desc,
1200 char* str,int* nold,int oldmax,char** dst) { 1200 char* str,int* nold,int oldmax,char** dst) {
1201 char* eq; 1201 char* eq;
1202 m_option_t* opt; 1202 m_option_t* opt;
1203 int r; 1203 int r;
1204 1204
1247 (*nold)++; 1247 (*nold)++;
1248 } 1248 }
1249 return 1; 1249 return 1;
1250 } 1250 }
1251 1251
1252 static int get_obj_params(char* opt_name, char* name,char* params, 1252 static int get_obj_params(const char* opt_name, const char* name,char* params,
1253 m_struct_t* desc,char separator, char*** _ret) { 1253 m_struct_t* desc,char separator, char*** _ret) {
1254 int n = 0,nold = 0, nopts,r; 1254 int n = 0,nold = 0, nopts,r;
1255 char* ptr,*last_ptr = params; 1255 char* ptr,*last_ptr = params;
1256 char** ret; 1256 char** ret;
1257 1257