Feature #770

Add const modifier to some arguments of GMT API functions

Added by Michael about 2 years ago. Updated about 2 years ago.

Status:ClosedStart date:2015-09-23
Priority:LowDue date:
Assignee:Paul% Done:

100%

Category:-
Target version:Candidate for next minor release
Platform:

Description

To prevent compiler warnings such as "deprecated conversion from string constant to «char*»" or "invalid conversion from 'const void*' to 'void*'" I offer to use const modifier in some arguments of GMT API functions.
The first parameter of the function GMT_Create_Session is an obvious case. The third argument of the GMT_Create_Options is an another case. I attach the simple patch for the first case (GMT_Create_Session), but the second case requires some internal modifications of GMT_Create_Options. I think that such a modification is needed, in order to be able to write something like GMT_Create_Options(api,0,"-O -K") or GMT_Create_Options(api,0,std_string.c_str()) without side effects.

GMT_Create_Session.patch Magnifier (3.87 KB) Michael, 2015-09-23 18:31

Associated revisions

Revision 14942
Added by Paul about 2 years ago

Address issue #770 and introduce const char * when possible

History

#1 Updated by Paul about 2 years ago

  • Status changed from New to In Progress
  • Assignee set to Paul

Thanks Michael; we will consider this for 5.2 out next month we hope.

#2 Updated by Paul about 2 years ago

  • Status changed from In Progress to Resolved
  • Target version set to Candidate for next minor release
  • % Done changed from 0 to 100

I've gone through all the API functions and unless text is returned via a char * pointer I have made changes so they are all const char *. In r14942 [GMT 5.2].

#3 Updated by Paul about 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF