Created
February 19, 2014 17:29
-
-
Save schwehr/9096958 to your computer and use it in GitHub Desktop.
What it takes to make a parameter const for a function. You must edit (at a minimum) both the function prototype and function definition. Here, I am making the verbose argument const.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
svn diff mb_define.h mb_defaults.c | |
Index: mb_define.h | |
=================================================================== | |
--- mb_define.h (revision 2165) | |
+++ mb_define.h (working copy) | |
@@ -315,7 +315,7 @@ | |
#define MB_PROJECTION_PROJECTED 1 | |
/* MBIO core function prototypes */ | |
-int mb_defaults(int verbose, int *format, int *pings, | |
+int mb_defaults(const int verbose, int *format, int *pings, | |
int *lonflip, double bounds[4], | |
int *btime_i, int *etime_i, | |
double *speedmin, double *timegap); | |
Index: mb_defaults.c | |
=================================================================== | |
--- mb_defaults.c (revision 2165) | |
+++ mb_defaults.c (working copy) | |
@@ -120,7 +120,7 @@ | |
static char rcs_id[]="$Id$"; | |
/*--------------------------------------------------------------------*/ | |
-int mb_defaults(int verbose, int *format, int *pings, | |
+int mb_defaults(const int verbose, int *format, int *pings, | |
int *lonflip, double bounds[4], | |
int *btime_i, int *etime_i, | |
double *speedmin, double *timegap) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment