Another message, fixing one of the patches.

-------- Message transféré --------
Sujet : Re: [tex-live] Gregorio integration
Date : Tue, 4 Aug 2015 11:25:58 +0200 (CEST)
De : Peter Breitenlohner <[email protected]>
Pour : Karl Berry <[email protected]>
Copie à : [email protected]

On Tue, 4 Aug 2015, Peter Breitenlohner wrote:

> patch-04-unsigned: Avoid undefined behaviour when char is unsigned (Cygwin
should have been                                         is signed
> gcc warns about this).

attached a corrected version of that patch.

Regards
Peter


        Avoid undefined behaviour when char is signed.

diff -ur gregorio-4.0.0-beta.orig/src/gabc/gabc-notes-determination.l 
gregorio-4.0.0-beta/src/gabc/gabc-notes-determination.l
--- gregorio-4.0.0-beta.orig/src/gabc/gabc-notes-determination.l        
2015-08-03 14:49:07.000000000 +0200
+++ gregorio-4.0.0-beta/src/gabc/gabc-notes-determination.l     2015-08-04 
10:27:23.000000000 +0200
@@ -60,7 +60,7 @@
 {
     nbof_isolated_episemus = 0;
     gregorio_add_note(&current_note,
-            pitch_letter_to_height(tolower(gabc_notes_determination_text[i])),
+            pitch_letter_to_height(tolower((unsigned 
char)gabc_notes_determination_text[i])),
             shape, signs, liquescentia, NULL, &notes_lloc);
 }
 
diff -ur gregorio-4.0.0-beta.orig/src/gabc/gabc-notes-determination-l.c 
gregorio-4.0.0-beta/src/gabc/gabc-notes-determination-l.c
--- gregorio-4.0.0-beta.orig/src/gabc/gabc-notes-determination-l.c      
2015-08-03 17:21:37.000000000 +0200
+++ gregorio-4.0.0-beta/src/gabc/gabc-notes-determination-l.c   2015-08-04 
10:27:26.000000000 +0200
@@ -7258,7 +7258,7 @@
 {
     nbof_isolated_episemus = 0;
     gregorio_add_note(&current_note,
-            pitch_letter_to_height(tolower(gabc_notes_determination_text[i])),
+            pitch_letter_to_height(tolower((unsigned 
char)gabc_notes_determination_text[i])),
             shape, signs, liquescentia, NULL, &notes_lloc);
 }
 
diff -ur gregorio-4.0.0-beta.orig/src/gabc/gabc-write.c 
gregorio-4.0.0-beta/src/gabc/gabc-write.c
--- gregorio-4.0.0-beta.orig/src/gabc/gabc-write.c      2015-08-03 
13:53:58.000000000 +0200
+++ gregorio-4.0.0-beta/src/gabc/gabc-write.c   2015-08-04 10:28:45.000000000 
+0200
@@ -412,27 +412,27 @@
         fprintf(f, "%c", pitch_letter(note->u.note.pitch));
         break;
     case S_PUNCTUM_INCLINATUM:
-        fprintf(f, "%c", toupper(pitch_letter(note->u.note.pitch)));
+        fprintf(f, "%c", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         break;
     case S_PUNCTUM_INCLINATUM_DEMINUTUS:
         if (note->next) {
-            fprintf(f, "%c~", toupper(pitch_letter(note->u.note.pitch)));
+            fprintf(f, "%c~", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         } else {
-            fprintf(f, "%c", toupper(pitch_letter(note->u.note.pitch)));
+            fprintf(f, "%c", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         }
         break;
     case S_PUNCTUM_INCLINATUM_AUCTUS:
         if (note->next) {
-            fprintf(f, "%c<", toupper(pitch_letter(note->u.note.pitch)));
+            fprintf(f, "%c<", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         } else {
-            fprintf(f, "%c", toupper(pitch_letter(note->u.note.pitch)));
+            fprintf(f, "%c", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         }
         break;
     case S_PUNCTUM_CAVUM_INCLINATUM:
-        fprintf(f, "%cr", toupper(pitch_letter(note->u.note.pitch)));
+        fprintf(f, "%cr", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         break;
     case S_PUNCTUM_CAVUM_INCLINATUM_AUCTUS:
-        fprintf(f, "%cr<", toupper(pitch_letter(note->u.note.pitch)));
+        fprintf(f, "%cr<", toupper((unsigned 
char)pitch_letter(note->u.note.pitch)));
         break;
     case S_VIRGA:
         fprintf(f, "%cv", pitch_letter(note->u.note.pitch));
_______________________________________________
Gregorio-devel mailing list
[email protected]
https://mail.gna.org/listinfo/gregorio-devel

Répondre à