Add const qualifiers in Tcl/Tk bindings
authorStephane Glondu <steph@glondu.net>
Thu, 7 Nov 2013 14:45:50 +0000 (15:45 +0100)
committerStéphane Glondu <glondu@debian.org>
Thu, 30 Oct 2014 08:28:06 +0000 (08:28 +0000)
Bug: http://caml.inria.fr/mantis/view.php?id=6230

Gbp-Pq: Name 0010-Add-const-qualifiers-in-Tcl-Tk-bindings.patch

otherlibs/labltk/support/camltk.h
otherlibs/labltk/support/cltkCaml.c
otherlibs/labltk/support/cltkUtf.c

index 9efbbea33806c4df77b80a279eb083ca72f14326..6ee65584a5154bc80a50cf97d0a88b8e36000aa5 100644 (file)
@@ -40,7 +40,7 @@
 extern char *string_to_c(value s);
 
 /* cltkUtf.c */
-extern value tcl_string_to_caml( char * );
+extern value tcl_string_to_caml( CONST84 char * );
 extern char * caml_string_to_tcl( value );
 
 /* cltkEval.c */
@@ -53,7 +53,7 @@ extern value *tkerror_exn;
 extern value *handler_code;
 extern int CamlCBCmd(ClientData clientdata, Tcl_Interp *interp,
                      int argc, CONST84 char *argv[]);
-CAMLTKextern void tk_error(char * errmsg) Noreturn;
+CAMLTKextern void tk_error(CONST84 char * errmsg) Noreturn;
 
 /* cltkMain.c */
 extern int signal_events;
index 9a3d38a5505bd701a4485a336a3120dd3785e69c..5c6aae08574ccf57eb581525c109be26aa7773a8 100644 (file)
@@ -63,7 +63,7 @@ CAMLprim value camltk_return (value v)
 }
 
 /* Note: raise_with_string WILL copy the error message */
-CAMLprim void tk_error(char *errmsg)
+CAMLprim void tk_error(CONST84 char *errmsg)
 {
   raise_with_string(*tkerror_exn, errmsg);
 }
index 61dbfb2f5d2d2c91fcac6c3cf3e4522e0f41b2e9..faaf30305b2b7d20cae37a10bc0115f024c72356 100644 (file)
@@ -36,7 +36,7 @@
 
 #ifdef UTFCONVERSION
 
-char *external_to_utf( char *str ){
+char *external_to_utf( CONST84 char *str ){
   char *res;
   Tcl_DString dstr;
   int length;
@@ -50,7 +50,7 @@ char *external_to_utf( char *str ){
   return res;
 }
 
-char *utf_to_external( char *str ){
+char *utf_to_external( CONST84 char *str ){
   char *res;
   Tcl_DString dstr;
   int length;
@@ -69,7 +69,7 @@ char *caml_string_to_tcl( value s )
   return external_to_utf( String_val(s) );
 }
 
-value tcl_string_to_caml( char *s )
+value tcl_string_to_caml( CONST84 char *s )
 {
   CAMLparam0();
   CAMLlocal1(res);
@@ -84,6 +84,6 @@ value tcl_string_to_caml( char *s )
 #else
 
 char *caml_string_to_tcl(value s){ return string_to_c(s); }
-value tcl_string_to_caml(char *s){ return copy_string(s); }
+value tcl_string_to_caml(CONST84 char *s){ return copy_string(s); }
 
 #endif