Skip to content

_comedilib_h: Add 'const' to functions returning const char*#5

Open
andersm wants to merge 1 commit intowking:masterfrom
andersm:const_decl
Open

_comedilib_h: Add 'const' to functions returning const char*#5
andersm wants to merge 1 commit intowking:masterfrom
andersm:const_decl

Conversation

@andersm
Copy link

@andersm andersm commented Oct 10, 2018

This fixes compiler warnings about discarded const qualifiers:

pycomedi/_error.c:1353:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_comedi_msg = comedi_strerror(__pyx_v_errno);
pycomedi/device.c:2605:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_ret = comedi_get_driver_name(__pyx_v_self->__pyx_base.device);
pycomedi/device.c:2741:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
__pyx_v_ret = comedi_get_board_name(__pyx_v_self->__pyx_base.device);

Const is supported since Cython 0.18 (2013-01-28)
1:

C const declarations are supported in the language.

This fixes compiler warnings about discarded const qualifiers:

pycomedi/_error.c:1353:22: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_comedi_msg = comedi_strerror(__pyx_v_errno);
pycomedi/device.c:2605:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_ret = comedi_get_driver_name(__pyx_v_self->__pyx_base.device);
pycomedi/device.c:2741:15: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   __pyx_v_ret = comedi_get_board_name(__pyx_v_self->__pyx_base.device);

Const is supported since Cython 0.18 (2013-01-28)
[1]:

  C const declarations are supported in the language.

[1]: https://github.com/cython/cython/blob/master/CHANGES.rst#018-2013-01-28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant