summaryrefslogtreecommitdiff
path: root/subvertpy
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@jelmer.uk>2016-07-09 23:13:10 +0000
committerJelmer Vernooij <jelmer@jelmer.uk>2016-07-09 23:13:10 +0000
commit1448bc5efb5c0438b7d633daacb62ff49d49b42b (patch)
tree836ce870998a244af348f03d5ddfb666da41e291 /subvertpy
parent3408453c281850f0a3f20aaa04da8c2c0644a886 (diff)
Fix const errors.
Diffstat (limited to 'subvertpy')
-rw-r--r--subvertpy/_ra.c22
-rw-r--r--subvertpy/client.c9
-rw-r--r--subvertpy/editor.c15
-rw-r--r--subvertpy/repos.c2
-rw-r--r--subvertpy/util.c8
-rw-r--r--subvertpy/util.h4
6 files changed, 32 insertions, 28 deletions
diff --git a/subvertpy/_ra.c b/subvertpy/_ra.c
index a8d54fe1..a1153002 100644
--- a/subvertpy/_ra.c
+++ b/subvertpy/_ra.c
@@ -46,7 +46,7 @@ static PyTypeObject AuthProvider_Type;
static PyTypeObject CredentialsIter_Type;
static PyTypeObject Auth_Type;
-static bool ra_check_svn_path(char *path)
+static bool ra_check_svn_path(const char *path)
{
/* svn_ra_check_path will raise an assertion error if the path has a
* leading '/'. Raise a Python exception if there ar eleading '/'s so that
@@ -121,8 +121,8 @@ typedef struct {
bool busy;
PyObject *client_string_func;
PyObject *open_tmp_file_func;
- char *root;
- char *corrected_url;
+ const char *root;
+ const char *corrected_url;
} RemoteAccessObject;
typedef struct {
@@ -1392,12 +1392,12 @@ static PyObject *ra_get_dir(PyObject *self, PyObject *args, PyObject *kwargs)
RemoteAccessObject *ra = (RemoteAccessObject *)self;
svn_dirent_t *dirent;
apr_ssize_t klen;
- char *path;
+ const char *path;
PyObject *py_path;
svn_revnum_t revision = -1;
unsigned int dirent_fields = 0;
PyObject *py_dirents, *py_props;
- char *kwnames[] = { "path", "revision", "fields", NULL };
+ char *kwnames[] = { "path", "revision", "fields", NULL };
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|lI:get_dir", kwnames,
&py_path, &revision, &dirent_fields))
@@ -1472,7 +1472,7 @@ fail:
static PyObject *ra_get_file(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
svn_revnum_t revision = -1;
RemoteAccessObject *ra = (RemoteAccessObject *)self;
@@ -1540,7 +1540,7 @@ static PyObject *ra_get_lock(PyObject *self, PyObject *args)
static PyObject *ra_check_path(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
RemoteAccessObject *ra = (RemoteAccessObject *)self;
svn_revnum_t revision;
svn_node_kind_t kind;
@@ -1572,7 +1572,7 @@ static PyObject *ra_check_path(PyObject *self, PyObject *args)
static PyObject *ra_stat(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
RemoteAccessObject *ra = (RemoteAccessObject *)self;
PyObject *ret;
@@ -1717,7 +1717,7 @@ fail_busy:
static PyObject *ra_get_locks(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
apr_pool_t *temp_pool;
apr_hash_t *hash_locks;
@@ -1777,7 +1777,7 @@ static PyObject *ra_get_locks(PyObject *self, PyObject *args)
static PyObject *ra_get_locations(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
RemoteAccessObject *ra = (RemoteAccessObject *)self;
svn_revnum_t peg_revision;
@@ -1992,7 +1992,7 @@ static PyObject *ra_get_location_segments(PyObject *self, PyObject *args)
#if ONLY_SINCE_SVN(1, 5)
RemoteAccessObject *ra = (RemoteAccessObject *)self;
svn_revnum_t peg_revision, start_revision, end_revision;
- char *path;
+ const char *path;
PyObject *py_path;
PyObject *py_rcvr;
apr_pool_t *temp_pool;
diff --git a/subvertpy/client.c b/subvertpy/client.c
index 4115371d..a2cffd09 100644
--- a/subvertpy/client.c
+++ b/subvertpy/client.c
@@ -529,11 +529,12 @@ static PyObject *client_checkout(PyObject *self, PyObject *args, PyObject *kwarg
char *kwnames[] = { "url", "path", "rev", "peg_rev", "recurse", "ignore_externals", "allow_unver_obstructions", NULL };
svn_revnum_t result_rev;
svn_opt_revision_t c_peg_rev, c_rev;
- char *path, *url;
+ char *path;
+ const char *url;
PyObject *py_url = NULL;
- apr_pool_t *temp_pool;
- PyObject *peg_rev=Py_None, *rev=Py_None;
- bool recurse=true, ignore_externals=false, allow_unver_obstructions=false;
+ apr_pool_t *temp_pool;
+ PyObject *peg_rev=Py_None, *rev=Py_None;
+ bool recurse=true, ignore_externals=false, allow_unver_obstructions=false;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Os|OObbb", kwnames, &py_url, &path, &rev, &peg_rev, &recurse, &ignore_externals, &allow_unver_obstructions))
return NULL;
diff --git a/subvertpy/editor.c b/subvertpy/editor.c
index 1bd3e6c3..4daffdb5 100644
--- a/subvertpy/editor.c
+++ b/subvertpy/editor.c
@@ -368,7 +368,7 @@ PyTypeObject FileEditor_Type = {
static PyObject *py_dir_editor_delete_entry(PyObject *self, PyObject *args)
{
EditorObject *editor = (EditorObject *)self;
- char *path;
+ const char *path;
PyObject *py_path;
svn_revnum_t revision = -1;
@@ -398,7 +398,7 @@ static PyObject *py_dir_editor_delete_entry(PyObject *self, PyObject *args)
static PyObject *py_dir_editor_add_directory(PyObject *self, PyObject *args)
{
PyObject *py_path;
- char *path;
+ const char *path;
char *copyfrom_path = NULL;
svn_revnum_t copyfrom_rev = -1;
void *child_baton;
@@ -438,7 +438,7 @@ static PyObject *py_dir_editor_add_directory(PyObject *self, PyObject *args)
static PyObject *py_dir_editor_open_directory(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
EditorObject *editor = (EditorObject *)self;
svn_revnum_t base_revision=-1;
@@ -532,7 +532,7 @@ static PyObject *py_dir_editor_close(PyObject *self)
static PyObject *py_dir_editor_absent_directory(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
EditorObject *editor = (EditorObject *)self;
@@ -562,7 +562,8 @@ static PyObject *py_dir_editor_absent_directory(PyObject *self, PyObject *args)
static PyObject *py_dir_editor_add_file(PyObject *self, PyObject *args)
{
- char *path, *copy_path=NULL;
+ const char *path;
+ char *copy_path=NULL;
PyObject *py_path;
svn_revnum_t copy_rev=-1;
void *file_baton = NULL;
@@ -601,7 +602,7 @@ static PyObject *py_dir_editor_add_file(PyObject *self, PyObject *args)
static PyObject *py_dir_editor_open_file(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
svn_revnum_t base_revision=-1;
void *file_baton;
@@ -639,7 +640,7 @@ static PyObject *py_dir_editor_open_file(PyObject *self, PyObject *args)
static PyObject *py_dir_editor_absent_file(PyObject *self, PyObject *args)
{
- char *path;
+ const char *path;
PyObject *py_path;
EditorObject *editor = (EditorObject *)self;
diff --git a/subvertpy/repos.c b/subvertpy/repos.c
index c5874280..f23a66bc 100644
--- a/subvertpy/repos.c
+++ b/subvertpy/repos.c
@@ -86,7 +86,7 @@ static void repos_dealloc(PyObject *self)
static PyObject *repos_init(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
- char *path;
+ const char *path;
char *kwnames[] = { "path", NULL };
svn_error_t *err;
RepositoryObject *ret;
diff --git a/subvertpy/util.c b/subvertpy/util.c
index e5893e85..4db00b67 100644
--- a/subvertpy/util.c
+++ b/subvertpy/util.c
@@ -92,7 +92,7 @@ char *py_object_to_svn_string(PyObject *obj, apr_pool_t *pool)
}
}
-char *py_object_to_svn_uri(PyObject *obj, apr_pool_t *pool)
+const char *py_object_to_svn_uri(PyObject *obj, apr_pool_t *pool)
{
const char *ret;
PyObject *bytes_obj = NULL;
@@ -116,8 +116,9 @@ char *py_object_to_svn_uri(PyObject *obj, apr_pool_t *pool)
}
}
-char *py_object_to_svn_relpath(PyObject *obj, apr_pool_t *pool)
+const char *py_object_to_svn_relpath(PyObject *obj, apr_pool_t *pool)
{
+ const char *ret;
PyObject *bytes_obj = NULL;
if (PyUnicode_Check(obj)) {
@@ -128,8 +129,9 @@ char *py_object_to_svn_relpath(PyObject *obj, apr_pool_t *pool)
}
if (PyBytes_Check(obj)) {
- return svn_relpath_canonicalize(PyBytes_AsString(obj), pool);
+ ret = svn_relpath_canonicalize(PyBytes_AsString(obj), pool);
Py_XDECREF(bytes_obj);
+ return ret;
} else {
Py_XDECREF(bytes_obj);
PyErr_SetString(PyExc_TypeError,
diff --git a/subvertpy/util.h b/subvertpy/util.h
index 6b902cd0..b82b174a 100644
--- a/subvertpy/util.h
+++ b/subvertpy/util.h
@@ -152,8 +152,8 @@ svn_relpath_canonicalize(const char *relpath,
apr_pool_t *result_pool);
#endif
-char *py_object_to_svn_uri(PyObject *obj, apr_pool_t *pool);
-char *py_object_to_svn_relpath(PyObject *obj, apr_pool_t *pool);
+const char *py_object_to_svn_uri(PyObject *obj, apr_pool_t *pool);
+const char *py_object_to_svn_relpath(PyObject *obj, apr_pool_t *pool);
char *py_object_to_svn_string(PyObject *obj, apr_pool_t *pool);
#endif /* _SUBVERTPY_UTIL_H_ */