Skip to content

Commit

Permalink
Fixed warnings in php/mapscript
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/mapserver/trunk@9154 7532c77e-422f-0410-93f4-f0b67bdd69e2
  • Loading branch information
Alan Boudreault committed Jul 8, 2009
1 parent 58bff19 commit 9e078db
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions mapregex.c
Expand Up @@ -52,20 +52,20 @@
#include "mapregex.h"
#include <regex.h>

API_EXPORT(int) ms_regcomp(ms_regex_t *regex, const char *expr, int cflags)
MS_API_EXPORT(int) ms_regcomp(ms_regex_t *regex, const char *expr, int cflags)
{
/* Must free in regfree() */
regex_t* sys_regex = (regex_t*) malloc(sizeof(regex_t));
regex->sys_regex = (void*) sys_regex;
return regcomp(sys_regex, expr, cflags);
}

API_EXPORT(size_t) ms_regerror(int errcode, const ms_regex_t *regex, char *errbuf, size_t errbuf_size)
MS_API_EXPORT(size_t) ms_regerror(int errcode, const ms_regex_t *regex, char *errbuf, size_t errbuf_size)
{
return regerror(errcode, (regex_t*)(regex->sys_regex), errbuf, errbuf_size);
}

API_EXPORT(int) ms_regexec(const ms_regex_t *regex, const char *string, size_t nmatch, ms_regmatch_t pmatch[], int eflags)
MS_API_EXPORT(int) ms_regexec(const ms_regex_t *regex, const char *string, size_t nmatch, ms_regmatch_t pmatch[], int eflags)
{
/*This next line only works because we know that regmatch_t
and ms_regmatch_t are exactly alike (POSIX STANDARD)*/
Expand All @@ -74,7 +74,7 @@ API_EXPORT(int) ms_regexec(const ms_regex_t *regex, const char *string, size_t n
(regmatch_t*) pmatch, eflags);
}

API_EXPORT(void) ms_regfree(ms_regex_t *regex)
MS_API_EXPORT(void) ms_regfree(ms_regex_t *regex)
{
regfree((regex_t*)(regex->sys_regex));
free(regex->sys_regex);
Expand Down
14 changes: 7 additions & 7 deletions mapregex.h
Expand Up @@ -37,11 +37,11 @@ extern "C" {
/* We want these to match the POSIX standard, so we need these*/
/* === regex2.h === */
#ifdef WIN32
#define API_EXPORT(type) __declspec(dllexport) type __stdcall
#define MS_API_EXPORT(type) __declspec(dllexport) type __stdcall
#elif defined(__GNUC__) && __GNUC__ >= 4
#define API_EXPORT(type) __attribute__ ((visibility("default"))) type
#define MS_API_EXPORT(type) __attribute__ ((visibility("default"))) type
#else
#define API_EXPORT(type) type
#define MS_API_EXPORT(type) type
#endif

typedef struct {
Expand All @@ -55,10 +55,10 @@ extern "C" {
ms_regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
} ms_regmatch_t;

API_EXPORT(int) ms_regcomp(ms_regex_t *, const char *, int);
API_EXPORT(size_t) ms_regerror(int, const ms_regex_t *, char *, size_t);
API_EXPORT(int) ms_regexec(const ms_regex_t *, const char *, size_t, ms_regmatch_t [], int);
API_EXPORT(void) ms_regfree(ms_regex_t *);
MS_API_EXPORT(int) ms_regcomp(ms_regex_t *, const char *, int);
MS_API_EXPORT(size_t) ms_regerror(int, const ms_regex_t *, char *, size_t);
MS_API_EXPORT(int) ms_regexec(const ms_regex_t *, const char *, size_t, ms_regmatch_t [], int);
MS_API_EXPORT(void) ms_regfree(ms_regex_t *);

#ifndef BUILDING_REGEX_PROXY

Expand Down
6 changes: 3 additions & 3 deletions mapscript/php3/php_mapscript_util.h
Expand Up @@ -44,10 +44,10 @@
#define TSRMLS_CC
#endif

/* PHP >=5.3 replaced ZVAL_DELREF by Z_DELREF */
/* PHP >=5.3 replaced ZVAL_DELREF by Z_DELREF_P */
#if ZEND_MODULE_API_NO >= 20090626
#define ZVAL_DELREF Z_DELREF
#define ZVAL_ADDREF Z_ADDREF
#define ZVAL_DELREF Z_DELREF_P
#define ZVAL_ADDREF Z_ADDREF_P
#endif

/**********************************************************************
Expand Down
8 changes: 4 additions & 4 deletions mapscript/php3/php_regex.c
Expand Up @@ -66,20 +66,20 @@



API_EXPORT(int) ms_regcomp(ms_regex_t *regex, const char *expr, int cflags)
MS_API_EXPORT(int) ms_regcomp(ms_regex_t *regex, const char *expr, int cflags)
{
/* Must free in regfree() */
regex_t* sys_regex = (regex_t*) malloc(sizeof(regex_t));
regex->sys_regex = (void*) sys_regex;
return regcomp(sys_regex, expr, cflags);
}

API_EXPORT(size_t) ms_regerror(int errcode, const ms_regex_t *regex, char *errbuf, size_t errbuf_size)
MS_API_EXPORT(size_t) ms_regerror(int errcode, const ms_regex_t *regex, char *errbuf, size_t errbuf_size)
{
return regerror(errcode, (regex_t*)(regex->sys_regex), errbuf, errbuf_size);
}

API_EXPORT(int) ms_regexec(const ms_regex_t *regex, const char *string, size_t nmatch, ms_regmatch_t pmatch[], int eflags)
MS_API_EXPORT(int) ms_regexec(const ms_regex_t *regex, const char *string, size_t nmatch, ms_regmatch_t pmatch[], int eflags)
{
/*This next line only works because we know that regmatch_t
and ms_regmatch_t are exactly alike (POSIX STANDARD)*/
Expand All @@ -88,7 +88,7 @@ API_EXPORT(int) ms_regexec(const ms_regex_t *regex, const char *string, size_t n
(regmatch_t*) pmatch, eflags);
}

API_EXPORT(void) ms_regfree(ms_regex_t *regex)
MS_API_EXPORT(void) ms_regfree(ms_regex_t *regex)
{
regfree((regex_t*)(regex->sys_regex));
free(regex->sys_regex);
Expand Down

0 comments on commit 9e078db

Please sign in to comment.