Skip to content

Commit 46fd93f

Browse files
committed
ext/dba: make string pointers const
1 parent 3a7f647 commit 46fd93f

File tree

10 files changed

+14
-14
lines changed

10 files changed

+14
-14
lines changed

ext/dba/dba.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,10 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, bool persistent)
462462
dba_mode_t modenr;
463463
dba_info *info, *other;
464464
const dba_handler *hptr;
465-
char *error = NULL;
465+
const char *error = NULL;
466466
int lock_mode, lock_flag = 0;
467-
char *file_mode;
468-
char *lock_file_mode = NULL;
467+
const char *file_mode;
468+
const char *lock_file_mode = NULL;
469469
int persistent_flag = persistent ? STREAM_OPEN_PERSISTENT : 0;
470470
zend_string *opened_path = NULL;
471471
char *lock_name;

ext/dba/libcdb/cdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ int cdb_find(struct cdb *c, char *key, unsigned int len)
185185
/* }}} */
186186

187187
/* {{{ cdb_version */
188-
char *cdb_version()
188+
const char *cdb_version()
189189
{
190190
return "0.75, $Id$";
191191
}

ext/dba/libcdb/cdb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ int cdb_find(struct cdb *, char *, unsigned int);
4848
#define cdb_datapos(c) ((c)->dpos)
4949
#define cdb_datalen(c) ((c)->dlen)
5050

51-
char *cdb_version(void);
51+
const char *cdb_version(void);
5252

5353
#endif

ext/dba/libcdb/cdb_make.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ int cdb_make_finish(struct cdb_make *c)
236236
/* }}} */
237237

238238
/* {{{ cdb_make_version */
239-
char *cdb_make_version()
239+
const char *cdb_make_version()
240240
{
241241
return "0.75, $Id$";
242242
}

ext/dba/libcdb/cdb_make.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ int cdb_make_addbegin(struct cdb_make *, unsigned int, unsigned int);
5555
int cdb_make_addend(struct cdb_make *, unsigned int, unsigned int, uint32);
5656
int cdb_make_add(struct cdb_make *, char *, unsigned int, char *, unsigned int);
5757
int cdb_make_finish(struct cdb_make *);
58-
char *cdb_make_version(void);
58+
const char *cdb_make_version(void);
5959

6060
#endif

ext/dba/libflatfile/flatfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ datum flatfile_nextkey(flatfile *dba) {
276276
/* }}} */
277277

278278
/* {{{ flatfile_version */
279-
char *flatfile_version()
279+
const char *flatfile_version()
280280
{
281281
return "1.0, $Id$";
282282
}

ext/dba/libflatfile/flatfile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ int flatfile_delete(flatfile *dba, datum key_datum);
3939
int flatfile_findkey(flatfile *dba, datum key_datum);
4040
datum flatfile_firstkey(flatfile *dba);
4141
datum flatfile_nextkey(flatfile *dba);
42-
char *flatfile_version(void);
42+
const char *flatfile_version(void);
4343

4444
#endif

ext/dba/libinifile/inifile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*/
3939

4040
/* {{{ inifile_version */
41-
char *inifile_version()
41+
const char *inifile_version()
4242
{
4343
return "1.0, $Id$";
4444
}

ext/dba/libinifile/inifile.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int inifile_delete_ex(inifile *dba, const key_type *key, bool *found);
4949
int inifile_replace(inifile *dba, const key_type *key, const val_type *val);
5050
int inifile_replace_ex(inifile *dba, const key_type *key, const val_type *val, bool *found);
5151
int inifile_append(inifile *dba, const key_type *key, const val_type *val);
52-
char *inifile_version(void);
52+
const char *inifile_version(void);
5353

5454
key_type inifile_key_split(const char *group_name);
5555
char * inifile_key_string(const key_type *key);

ext/dba/php_dba.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ extern zend_module_entry dba_module_entry;
7373
#define dba_module_ptr &dba_module_entry
7474

7575
typedef struct dba_handler {
76-
char *name; /* handler name */
76+
const char *name; /* handler name */
7777
int flags; /* whether and how dba does locking and other flags*/
78-
zend_result (*open)(dba_info *, char **error);
78+
zend_result (*open)(dba_info *, const char **error);
7979
void (*close)(dba_info *);
8080
zend_string* (*fetch)(dba_info *, zend_string *, int);
8181
zend_result (*update)(dba_info *, zend_string *, zend_string *, int);
@@ -92,7 +92,7 @@ typedef struct dba_handler {
9292
/* common prototypes which must be supplied by modules */
9393

9494
#define DBA_OPEN_FUNC(x) \
95-
zend_result dba_open_##x(dba_info *info, char **error)
95+
zend_result dba_open_##x(dba_info *info, const char **error)
9696
#define DBA_CLOSE_FUNC(x) \
9797
void dba_close_##x(dba_info *info)
9898
#define DBA_FETCH_FUNC(x) \

0 commit comments

Comments
 (0)