parameters: (self, pyx_code, decl_code, all_buffer_types, pythran_types)
docstring: If we have any buffer specializations, write out some variable
          declarations and imports.
docstring_summary: If we have any buffer specializations, write out some variable
          declarations and imports.
docstring_tokens: If we have any buffer specializations write out some variable declarations and imports .
function: def _buffer_declarations(self, pyx_code, decl_code, all_buffer_types, pythran_types):
          """
          If we have any buffer specializations, write out some variable
          declarations and imports.
          """
          decl_code.put_chunk(
              u"""
                  ctypedef struct {{memviewslice_cname}}:
                      void *memview
  
                  void __PYX_XDEC_MEMVIEW({{memviewslice_cname}} *, int have_gil)
                  bint __pyx_memoryview_check(object)
              """)
  
          pyx_code.local_variable_declarations.put_chunk(
              u"""
                  cdef {{memviewslice_cname}} memslice
                  cdef Py_ssize_t itemsize
                  cdef bint dtype_signed
                  cdef char kind
  
                  itemsize = -1
              """)
  
          if pythran_types:
              pyx_code.local_variable_declarations.put_chunk(u"""
                  cdef bint arg_is_pythran_compatible
                  cdef Py_ssize_t cur_stride
              """)
  
          pyx_code.imports.put_chunk(
              u"""
                  cdef type ndarray
                  ndarray = __Pyx_ImportNumPyArrayTypeIfAvailable()
              """)
  
          seen_typedefs = set()
          seen_int_dtypes = set()
          for buffer_type in all_buffer_types:
              dtype = buffer_type.dtype
              dtype_name = self._dtype_name(dtype)
              if dtype.is_typedef:
                  if dtype_name not in seen_typedefs:
                      seen_typedefs.add(dtype_name)
                      decl_code.putln(
                          'ctypedef %s %s "%s"' % (dtype.resolve(), dtype_name,
                                                   dtype.empty_declaration_code()))
  
              if buffer_type.dtype.is_int:
                  if str(dtype) not in seen_int_dtypes:
                      seen_int_dtypes.add(str(dtype))
                      pyx_code.context.update(dtype_name=dtype_name,
                                              dtype_type=self._dtype_type(dtype))
                      pyx_code.local_variable_declarations.put_chunk(
                          u"""
                              cdef bint {{dtype_name}}_is_signed
                              {{dtype_name}}_is_signed = not (<{{dtype_type}}> -1 > 0)
                          """)
function_tokens: def _buffer_declarations ( self , pyx_code , decl_code , all_buffer_types , pythran_types ) : decl_code . put_chunk ( u"""
                  ctypedef struct {{memviewslice_cname}}:
                      void *memview
  
                  void __PYX_XDEC_MEMVIEW({{memviewslice_cname}} *, int have_gil)
                  bint __pyx_memoryview_check(object)
              """ ) pyx_code . local_variable_declarations . put_chunk ( u"""
                  cdef {{memviewslice_cname}} memslice
                  cdef Py_ssize_t itemsize
                  cdef bint dtype_signed
                  cdef char kind
  
                  itemsize = -1
              """ ) if pythran_types : pyx_code . local_variable_declarations . put_chunk ( u"""
                  cdef bint arg_is_pythran_compatible
                  cdef Py_ssize_t cur_stride
              """ ) pyx_code . imports . put_chunk ( u"""
                  cdef type ndarray
                  ndarray = __Pyx_ImportNumPyArrayTypeIfAvailable()
              """ ) seen_typedefs = set ( ) seen_int_dtypes = set ( ) for buffer_type in all_buffer_types : dtype = buffer_type . dtype dtype_name = self . _dtype_name ( dtype ) if dtype . is_typedef : if dtype_name not in seen_typedefs : seen_typedefs . add ( dtype_name ) decl_code . putln ( 'ctypedef %s %s "%s"' % ( dtype . resolve ( ) , dtype_name , dtype . empty_declaration_code ( ) ) ) if buffer_type . dtype . is_int : if str ( dtype ) not in seen_int_dtypes : seen_int_dtypes . add ( str ( dtype ) ) pyx_code . context . update ( dtype_name = dtype_name , dtype_type = self . _dtype_type ( dtype ) ) pyx_code . local_variable_declarations . put_chunk ( u"""
                              cdef bint {{dtype_name}}_is_signed
                              {{dtype_name}}_is_signed = not (<{{dtype_type}}> -1 > 0)
                          """ )