Re: [Announce] Amaya 10 .1-pre snapshot

Regis Boudin <[email protected]> Sun, 04 May 2008 23:47:09 +0100
Newsgroups gmane.comp.web.amaya.devel,gmane.comp.web.amaya.general
Message-ID <1209941229.3211.2.camel@x40>
Hi again,

And as a follow-up, another 2 patches, bringing the number of
"deprecated conversion from string constant to char*" warnings bellow
the 1000 mark.

To be applied on top of the previous 3.

Regis

On Fri, 2008-05-02 at 21:40 +0100, Regis Boudin wrote:
> Hi,
> 
> Based on the source snapshot, here are 3 fairly simple patches fixing
> over a thousand compile warnings.
> 
> The patch is split becau
> 
> As usual, feedback welcome.
> 
> Regis
> 
> On Tue, 2008-04-29 at 18:37 +0200, Irene Vatton wrote:
> > Hi,
> > 
> > A snapshot, Amaya 10.1-pre, is now available. 
> > 
> > Major changes are:
> >  o A new version of the formatting engine
> >  o Improvement of MathML editing
> >  o Possibility to enter a complex CSS selector when a 
> >    Style rule is created
> >  o Extension of templates to apply to all XML languages
> >  o Support of the HTML + RDFa profile
> >  o Several other bug fixes
> >
warnings4.diff (text/x-patch, 5.3 KB)
Index: amaya-10.1~pre1+dfsg1/amaya/AHTInit.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/amaya/AHTInit.c	2008-05-02 22:27:35.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/amaya/AHTInit.c	2008-05-02 22:27:48.000000000 +0100
@@ -188,7 +188,7 @@
 PUBLIC void HTMIMEInit (void)
 {
     struct {
-        char * string;
+        const char * string;
 	HTParserCallback * pHandler;
     } fixedHandlers[] = {
 	{"accept", &HTMIME_accept}, 
Index: amaya-10.1~pre1+dfsg1/thotlib/include/attribute.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/include/attribute.h	2008-05-02 21:48:52.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/include/attribute.h	2008-05-02 21:49:27.000000000 +0100
@@ -155,7 +155,7 @@
    attrKind: kind of the attribute: 0 = Enumerate, 1 = Integer, 2 = Text,
    3 = CsReference
    ---------------------------------------------------------------------- */
-extern void TtaGiveAttributeTypeFromName (char *name, Element element, AttributeType *attributeType, int *attrKind);
+extern void TtaGiveAttributeTypeFromName (const char *name, Element element, AttributeType *attributeType, int *attrKind);
 
 /* ----------------------------------------------------------------------
    TtaGiveAttributeTypeFromOriginalName
Index: amaya-10.1~pre1+dfsg1/thotlib/internals/f/attributeapi_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/internals/f/attributeapi_f.h	2008-05-02 21:50:48.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/internals/f/attributeapi_f.h	2008-05-02 21:51:02.000000000 +0100
@@ -32,7 +32,7 @@
 extern void TtaGiveAttributeType ( Attribute attribute,
                                    AttributeType *attType,
                                    int *attrKind );
-extern void TtaGiveAttributeTypeFromName ( char *name,
+extern void TtaGiveAttributeTypeFromName ( const char *name,
                                            Element element,
                                            AttributeType *attType,
                                            int *attrKind );
@@ -99,7 +99,7 @@
 extern void TtaGiveAttributeType ( Attribute attribute,
                                      AttributeType *attType,
                                      int *attrKind );
-extern void TtaGiveAttributeTypeFromName ( char *name,
+extern void TtaGiveAttributeTypeFromName ( const char *name,
                                              Element element,
                                              AttributeType *attType,
                                              int *attrKind );
Index: amaya-10.1~pre1+dfsg1/thotlib/internals/f/structschema_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/internals/f/structschema_f.h	2008-05-02 21:45:57.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/internals/f/structschema_f.h	2008-05-02 21:46:17.000000000 +0100
@@ -15,7 +15,7 @@
 extern void GetAttrRuleFromName ( int *attrNum,
                                   PtrSSchema *pSSch,
                                   PtrElement pElem,
-                                  char *attrName,
+                                  const char *attrName,
                                   int whichName );
 extern int GetTypeNumIdentity ( int typeNum,
                                 PtrSSchema pSS );
@@ -128,7 +128,7 @@
 extern void GetAttrRuleFromName ( int *attrNum,
                                     PtrSSchema *pSSch,
                                     PtrElement pElem,
-                                    char *attrName,
+                                    const char *attrName,
                                     int whichName );
 extern int GetTypeNumIdentity ( int typeNum,
                                   PtrSSchema pSS );
Index: amaya-10.1~pre1+dfsg1/thotlib/tree/attributeapi.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/tree/attributeapi.c	2008-05-02 21:50:14.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/tree/attributeapi.c	2008-05-02 21:50:29.000000000 +0100
@@ -763,7 +763,7 @@
    attrKind: kind of the attribute: 0 = Enumerate, 1 = Integer, 2 = Text,
    3 = CsReference
    ---------------------------------------------------------------------- */
-void TtaGiveAttributeTypeFromName (char *name, Element element,
+void TtaGiveAttributeTypeFromName (const char *name, Element element,
                                    AttributeType *attType, int *attrKind)
 {
   PtrSSchema          pSS;
Index: amaya-10.1~pre1+dfsg1/thotlib/tree/structschema.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/tree/structschema.c	2008-05-02 21:44:41.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/tree/structschema.c	2008-05-02 21:45:05.000000000 +0100
@@ -144,7 +144,7 @@
   n'est pas trouve'.                                      
   ----------------------------------------------------------------------*/
 void GetAttrRuleFromName (int *attrNum, PtrSSchema *pSSch,
-                          PtrElement pElem, char *attrName, int whichName)
+                          PtrElement pElem, const char *attrName, int whichName)
 {
   int                 i;
   ThotBool            found, newCshema;
warnings5.diff (text/x-patch, 13.4 KB)
Index: amaya-10.1~pre1+dfsg1/batch/f/parser_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/batch/f/parser_f.h	2008-05-04 22:47:58.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/batch/f/parser_f.h	2008-05-04 22:48:18.000000000 +0100
@@ -22,7 +22,7 @@
                            int *rank,
                            SyntRuleNum *pr );
 extern void ParserEnd ( void );
-extern void InitSyntax ( char *fileName );
+extern void InitSyntax ( const char *fileName );
 
 #else /* __STDC__ */
 
@@ -42,7 +42,7 @@
                              int *rank,
                              SyntRuleNum *pr );
 extern void ParserEnd ( void );
-extern void InitSyntax ( char *fileName );
+extern void InitSyntax ( const char *fileName );
 
 #endif /* __STDC__ */
 #endif /* __CEXTRACT__ */
Index: amaya-10.1~pre1+dfsg1/batch/parser.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/batch/parser.c	2008-05-04 22:47:33.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/batch/parser.c	2008-05-04 22:47:44.000000000 +0100
@@ -812,7 +812,7 @@
    regles a` partir d'un fichier grammaire de type GRM.		
    fileName est le nom du fichier grammaire, avec le suffixe .GRM.	
   ----------------------------------------------------------------------*/
-void InitSyntax (char *fileName)
+void InitSyntax (const char *fileName)
 {
   indLine             j, wind, wlen;
   SyntacticType       wnat;
Index: amaya-10.1~pre1+dfsg1/thotlib/document/docs.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/document/docs.c	2008-05-04 22:43:21.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/document/docs.c	2008-05-04 22:43:50.000000000 +0100
@@ -115,7 +115,7 @@
   the document that has been created or 0 if the document has not
   been created.
   ----------------------------------------------------------------------*/
-Document TtaInitDocument (char *structureSchema, char *documentName,
+Document TtaInitDocument (char *structureSchema, const char *documentName,
                           Document document)
 {
   PtrDocument         pDoc;
@@ -225,7 +225,7 @@
   the document that has been created or 0 if the document has not
   been created.
   ----------------------------------------------------------------------*/
-Document TtaNewDocument (char *structureSchema, char *documentName)
+Document TtaNewDocument (char *structureSchema, const char *documentName)
 {
   return TtaInitDocument (structureSchema, documentName, 0);
 }
Index: amaya-10.1~pre1+dfsg1/thotlib/include/tree.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/include/tree.h	2008-05-04 22:28:21.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/include/tree.h	2008-05-04 22:28:34.000000000 +0100
@@ -124,7 +124,7 @@
    the root element of the created tree.
    ---------------------------------------------------------------------- */
 extern Element TtaNewTree (Document document, ElementType elementType,
-			   char* label);
+			   const char* label);
 
 /* ----------------------------------------------------------------------
    TtaNewTranscludedElement
Index: amaya-10.1~pre1+dfsg1/thotlib/internals/f/docs_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/internals/f/docs_f.h	2008-05-04 22:44:31.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/internals/f/docs_f.h	2008-05-04 22:44:55.000000000 +0100
@@ -8,10 +8,10 @@
 
 extern Document TtaGetNextDocumentIndex ( void );
 extern Document TtaInitDocument ( char *structureSchema,
-                                  char *documentName,
+                                  const char *documentName,
                                   Document document );
 extern Document TtaNewDocument ( char *structureSchema,
-                                 char *documentName );
+                                 const char *documentName );
 extern void NewDocument ( PtrDocument *pDoc,
                           char *SSchemaName,
                           char *docName,
@@ -31,10 +31,10 @@
 
 extern Document TtaGetNextDocumentIndex ( void );
 extern Document TtaInitDocument ( char *structureSchema,
-                                    char *documentName,
+                                    const char *documentName,
                                     Document document );
 extern Document TtaNewDocument ( char *structureSchema,
-                                   char *documentName );
+                                   const char *documentName );
 extern void NewDocument ( PtrDocument *pDoc,
                             char *SSchemaName,
                             char *docName,
Index: amaya-10.1~pre1+dfsg1/thotlib/internals/f/treeapi_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/internals/f/treeapi_f.h	2008-05-04 22:28:44.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/internals/f/treeapi_f.h	2008-05-04 22:29:03.000000000 +0100
@@ -18,7 +18,7 @@
                                ElementType elementType );
 extern Element TtaNewTree ( Document document,
                             ElementType elementType,
-                            char* label );
+                            const char* label );
 extern Element TtaNewTranscludedElement ( Document document,
                                           Element orig );
 extern Element TtaCopyTree ( Element sourceElement,
@@ -158,7 +158,7 @@
                                  ElementType elementType );
 extern Element TtaNewTree ( Document document,
                               ElementType elementType,
-                              char* label );
+                              const char* label );
 extern Element TtaNewTranscludedElement ( Document document,
                                             Element orig );
 extern Element TtaCopyTree ( Element sourceElement,
Index: amaya-10.1~pre1+dfsg1/thotlib/tree/treeapi.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/tree/treeapi.c	2008-05-04 22:29:15.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/tree/treeapi.c	2008-05-04 22:29:32.000000000 +0100
@@ -215,7 +215,7 @@
    Return value:
    the root element of the created tree.
    ---------------------------------------------------------------------- */
-Element TtaNewTree (Document document, ElementType elementType, char* label)
+Element TtaNewTree (Document document, ElementType elementType, const char* label)
 {
   PtrElement          element;
   
Index: amaya-10.1~pre1+dfsg1/batch/str.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/batch/str.c	2008-05-04 22:57:06.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/batch/str.c	2008-05-04 22:57:23.000000000 +0100
@@ -134,7 +134,7 @@
 /*----------------------------------------------------------------------
   InitBasicType                                                  
   ----------------------------------------------------------------------*/
-static void InitBasicType (SRule *pRule, char *name, BasicType typ)
+static void InitBasicType (SRule *pRule, const char *name, BasicType typ)
 {
   if (pRule->SrName == NULL)
     {
Index: amaya-10.1~pre1+dfsg1/thotlib/include/ustring.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/include/ustring.h	2008-05-04 23:00:11.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/include/ustring.h	2008-05-04 23:00:28.000000000 +0100
@@ -61,7 +61,7 @@
 /*----------------------------------------------------------------------
   TtaGetCharset gives the charset 
   ----------------------------------------------------------------------*/
-extern CHARSET TtaGetCharset (char *charsetname);
+extern CHARSET TtaGetCharset (const char *charsetname);
 
 /*----------------------------------------------------------------------
   TtaGetLocaleCharset returns the user system charset
Index: amaya-10.1~pre1+dfsg1/thotlib/internals/f/ustring_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/internals/f/ustring_f.h	2008-05-04 23:00:38.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/internals/f/ustring_f.h	2008-05-04 23:00:53.000000000 +0100
@@ -36,7 +36,7 @@
                          const CHAR_T *delemiter );
 extern CHAR_T *ustrstr ( const CHAR_T *str,
                          const CHAR_T *strCharSet );
-extern CHARSET TtaGetCharset ( char *charsetname );
+extern CHARSET TtaGetCharset ( const char *charsetname );
 extern CHARSET TtaGetLocaleCharset ( void );
 extern CHARSET TtaGetDefaultCharset ( void );
 extern const char *TtaGetCharsetName ( CHARSET charset );
@@ -73,7 +73,7 @@
                            const CHAR_T *delemiter );
 extern CHAR_T *ustrstr ( const CHAR_T *str,
                            const CHAR_T *strCharSet );
-extern CHARSET TtaGetCharset ( char *charsetname );
+extern CHARSET TtaGetCharset ( const char *charsetname );
 extern CHARSET TtaGetLocaleCharset ( void );
 extern CHARSET TtaGetDefaultCharset ( void );
 extern const char *TtaGetCharsetName ( CHARSET charset );
Index: amaya-10.1~pre1+dfsg1/thotlib/unicode/ustring.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/unicode/ustring.c	2008-05-04 22:59:35.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/unicode/ustring.c	2008-05-04 22:59:50.000000000 +0100
@@ -367,7 +367,7 @@
 /*----------------------------------------------------------------------
   TtaGetCharset gives the charset 
   ----------------------------------------------------------------------*/
-CHARSET TtaGetCharset (char *charsetname)
+CHARSET TtaGetCharset (const char *charsetname)
 {
   int index = 0;
 
Index: amaya-10.1~pre1+dfsg1/amaya/f/init_f.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/amaya/f/init_f.h	2008-05-04 23:19:24.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/amaya/f/init_f.h	2008-05-04 23:20:02.000000000 +0100
@@ -128,7 +128,7 @@
 extern Document InitDocAndView ( Document oldDoc,
                                  ThotBool replaceOldDoc,
                                  ThotBool inNewWindow,
-                                 char *docname,
+                                 const char *docname,
                                  DocumentType docType,
                                  Document sourceOfDoc,
                                  ThotBool readOnly,
@@ -389,7 +389,7 @@
 extern Document InitDocAndView ( Document oldDoc,
                                    ThotBool replaceOldDoc,
                                    ThotBool inNewWindow,
-                                   char *docname,
+                                   const char *docname,
                                    DocumentType docType,
                                    Document sourceOfDoc,
                                    ThotBool readOnly,
Index: amaya-10.1~pre1+dfsg1/amaya/init.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/amaya/init.c	2008-05-04 23:16:00.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/amaya/init.c	2008-05-04 23:16:12.000000000 +0100
@@ -2641,7 +2641,7 @@
   + ...
   ----------------------------------------------------------------------*/
 Document InitDocAndView (Document oldDoc, ThotBool replaceOldDoc, ThotBool inNewWindow,
-                         char *docname, DocumentType docType, Document sourceOfDoc,
+                         const char *docname, DocumentType docType, Document sourceOfDoc,
 			 ThotBool readOnly, int profile, int extraProfile, int method)
 {
   Document      doc; /* the new doc */
Index: amaya-10.1~pre1+dfsg1/annotlib/ANNOTfiles.c
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/annotlib/ANNOTfiles.c	2008-05-04 23:09:09.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/annotlib/ANNOTfiles.c	2008-05-04 23:15:51.000000000 +0100
@@ -61,7 +61,7 @@
   char     *fname;
   char     *docname;
   char     *tmpname;
-  char     *tmp;
+  const char     *tmp;
 
   /* Create a new annotation document */
   annot_dir = GetAnnotDir ();
@@ -993,7 +993,7 @@
 				  AnnotMeta *annot, AnnotMode mode)
 {
   char *source_doc_title;
-  char *text;
+  const char *text;
 #ifdef ANNOT_ON_ANNOT
   Element el;
   ElementType elType;
Index: amaya-10.1~pre1+dfsg1/thotlib/include/document.h
===================================================================
--- amaya-10.1~pre1+dfsg1.orig/thotlib/include/document.h	2008-05-04 23:13:52.000000000 +0100
+++ amaya-10.1~pre1+dfsg1/thotlib/include/document.h	2008-05-04 23:31:26.000000000 +0100
@@ -53,7 +53,7 @@
    the document that has been created or 0 if the document has not
    been created.
   ----------------------------------------------------------------------*/
-extern Document TtaInitDocument (char *structureSchema, char *documentName,
+extern Document TtaInitDocument (char *structureSchema, const char *documentName,
 				 Document document);
 
 /*----------------------------------------------------------------------
@@ -75,7 +75,7 @@
    the document that has been created or 0 if the document has not
    been created.
   ----------------------------------------------------------------------*/
-extern Document TtaNewDocument (char *structureSchema, char *documentName);
+extern Document TtaNewDocument (char *structureSchema, const char *documentName);
 
 /*----------------------------------------------------------------------
    TtaOpenDocument