Skip to content

Commit

Permalink
CLN: Address build warnings (#655)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Jun 10, 2020
1 parent 9211f89 commit ab1bb32
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 24 deletions.
32 changes: 16 additions & 16 deletions pyproj/_crs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1638,15 +1638,15 @@ cdef class Param:
@staticmethod
cdef Param create(PJ_CONTEXT* context, PJ* projobj, int param_idx):
cdef Param param = Param()
cdef char *out_name
cdef char *out_auth_name
cdef char *out_code
cdef char *out_value
cdef char *out_value_string
cdef char *out_unit_name
cdef char *out_unit_auth_name
cdef char *out_unit_code
cdef char *out_unit_category
cdef const char *out_name
cdef const char *out_auth_name
cdef const char *out_code
cdef const char *out_value
cdef const char *out_value_string
cdef const char *out_unit_name
cdef const char *out_unit_auth_name
cdef const char *out_unit_code
cdef const char *out_unit_category
cdef double value_double
proj_coordoperation_get_param(
context,
Expand Down Expand Up @@ -1722,10 +1722,10 @@ cdef class Grid:
@staticmethod
cdef Grid create(PJ_CONTEXT* context, PJ* projobj, int grid_idx):
cdef Grid grid = Grid()
cdef char *out_short_name
cdef char *out_full_name
cdef char *out_package_name
cdef char *out_url
cdef const char *out_short_name
cdef const char *out_full_name
cdef const char *out_package_name
cdef const char *out_url
cdef int direct_download = 0
cdef int open_license = 0
cdef int available = 0
Expand Down Expand Up @@ -1831,9 +1831,9 @@ cdef class CoordinateOperation(_CRSParts):
)
coord_operation.context = context
coord_operation.projobj = coord_operation_pj
cdef char *out_method_name = NULL
cdef char *out_method_auth_name = NULL
cdef char *out_method_code = NULL
cdef const char *out_method_name = NULL
cdef const char *out_method_auth_name = NULL
cdef const char *out_method_code = NULL
proj_coordoperation_get_method_info(
coord_operation.context,
coord_operation.projobj,
Expand Down
4 changes: 3 additions & 1 deletion pyproj/_datadir.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ cdef void set_context_data_dir(PJ_CONTEXT* context) except *:
if not proj_context_set_database_path(context, c_database_path, NULL, NULL):
warnings.warn("pyproj unable to set database path.")
data_dir_list.append(get_user_data_dir())
cdef char **c_data_dir = <char **>malloc(len(data_dir_list) * sizeof(char*))
cdef const char **c_data_dir = <const char **>malloc(
len(data_dir_list) * sizeof(const char*)
)
try:
for iii in range(len(data_dir_list)):
b_data_dir = cstrencode(data_dir_list[iii])
Expand Down
6 changes: 3 additions & 3 deletions pyproj/_list.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_proj_operations_map():
dict:
Operations supported by PROJ.
"""
cdef PJ_OPERATIONS *proj_operations = proj_list_operations()
cdef const PJ_OPERATIONS *proj_operations = proj_list_operations()
cdef int iii = 0
operations_map = {}
while proj_operations[iii].id != NULL:
Expand All @@ -33,7 +33,7 @@ def get_ellps_map():
dict:
Ellipsoids supported by PROJ.
"""
cdef PJ_ELLPS *proj_ellps = proj_list_ellps()
cdef const PJ_ELLPS *proj_ellps = proj_list_ellps()
cdef int iii = 0
ellps_map = {}
while proj_ellps[iii].id != NULL:
Expand All @@ -55,7 +55,7 @@ def get_prime_meridians_map():
dict:
Prime Meridians supported by PROJ.
"""
cdef PJ_PRIME_MERIDIANS *prime_meridians = proj_list_prime_meridians()
cdef const PJ_PRIME_MERIDIANS *prime_meridians = proj_list_prime_meridians()
cdef int iii = 0
prime_meridians_map = {}
while prime_meridians[iii].id != NULL:
Expand Down
5 changes: 3 additions & 2 deletions pyproj/_transformer.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Any, Iterable, List, NamedTuple, Optional, Tuple, Union
from array import array
from typing import Any, List, NamedTuple, Optional, Tuple, Union

from pyproj._crs import _CRS, AreaOfUse, Base, CoordinateOperation
from pyproj.enums import TransformDirection
Expand Down Expand Up @@ -89,7 +90,7 @@ class _Transformer(Base):
def _transform_sequence(
self,
stride: int,
inseq: Iterable[Iterable[float]],
inseq: array[float],
switch: bool,
direction: Union[TransformDirection, str],
time_3rd: bool,
Expand Down
3 changes: 2 additions & 1 deletion pyproj/_transformer.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
include "base.pxi"

cimport cython
from cpython cimport array

import copy
import warnings
Expand Down Expand Up @@ -552,7 +553,7 @@ cdef class _Transformer(Base):
def _transform_sequence(
self,
Py_ssize_t stride,
object inseq,
array.array inseq,
bint switch,
object direction,
bint time_3rd,
Expand Down
6 changes: 5 additions & 1 deletion pyproj/base.pxi
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
from cpython.ref cimport PyObject

from math import radians, degrees


cdef double _DG2RAD = radians(1.)
cdef double _RAD2DG = degrees(1.)
cdef int _DOUBLESIZE = sizeof(double)


cdef extern from "math.h":
cdef enum:
HUGE_VAL


cdef extern from "Python.h":
cdef struct PyObject
cdef int PyBUF_WRITABLE
int PyObject_GetBuffer(PyObject *exporter, Py_buffer *view, int flags)
void PyBuffer_Release(Py_buffer *view)
Expand Down

0 comments on commit ab1bb32

Please sign in to comment.