Feature #770

Add const modifier to some arguments of GMT API functions

Added by Michael over 5 years ago. Updated over 5 years ago.

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


Target version:Candidate for next minor release


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


#1 Updated by Paul over 5 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 over 5 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 over 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF