[liblouis-liblouisxml] [liblouis] r903 committed - Fix warnings in lou_trace

  • From: liblouis@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Thu, 24 Jan 2013 14:58:11 +0000

Revision: 903
Author:   christian.egli@xxxxxxxxxxxxxx
Date:     Thu Jan 24 06:57:53 2013
Log:      Fix warnings in lou_trace

http://code.google.com/p/liblouis/source/detail?r=903

Modified:
 /trunk/ChangeLog
 /trunk/tools/lou_trace.c

=======================================
--- /trunk/ChangeLog    Thu Jan 24 03:19:17 2013
+++ /trunk/ChangeLog    Thu Jan 24 06:57:53 2013
@@ -1,3 +1,7 @@
+2013-01-24  Christian Egli  <christian.egli@xxxxxx>
+
+       * tools/lou_trace.c: Fix warnings.
+
 2013-01-24  David Reynolds <dkreynolds@xxxxxxxxxxxx>

        * tables/en-gb-comp8.ctb: Add the British pound sign.
=======================================
--- /trunk/tools/lou_trace.c    Wed Dec 19 01:48:54 2012
+++ /trunk/tools/lou_trace.c    Thu Jan 24 06:57:53 2013
@@ -74,14 +74,14 @@
   return extParseChars(get_input(), buffer);
 }

-static char *print_chars(widechar *buffer, int length) {
+static char *print_chars(const widechar *buffer, int length) {
   static char chars[BUFSIZE];
   strcpy(chars, &showString(buffer, length)[1]);
   chars[strlen(chars) - 1] = 0;
   return chars;
 }

-static char *print_dots(widechar *buffer, int length) {
+static char *print_dots(const widechar *buffer, int length) {
   static char dots[BUFSIZE];
   strcpy(dots, showDots(buffer, length));
   return dots;
@@ -108,11 +108,10 @@
   (*length) += strlen(source);
 }

-static char *print_script(widechar *buffer, int length) {
+static char *print_script(const widechar *buffer, int length) {
   static char script[BUFSIZE];
   int i = 0;
   int j = 0;
-  int action = 0;
   while (i < length) {
     switch (buffer[i]) {
       case pass_first:
@@ -176,7 +175,6 @@
         break;
       case pass_endTest:
         append_char(script, &j, '\t');
-        action = 1;
         i++;
         break;
       case pass_swap:
@@ -191,8 +189,8 @@
   return script;
 }

-static void print_rule(TranslationTableRule *rule) {
-  char *opcode = findOpcodeName(rule->opcode);
+static void print_rule(const TranslationTableRule *rule) {
+  const char *opcode = findOpcodeName(rule->opcode);
   char *chars;
   char *dots;
   char *script;
@@ -219,7 +217,7 @@
   widechar outbuf[BUFSIZE];
   int inlen;
   int outlen;
- TranslationTableRule **rules = malloc(512 * sizeof(TranslationTableRule)); + const TranslationTableRule **rules = malloc(512 * sizeof(TranslationTableRule));
   int ruleslen;
   int i;
   while (1) {
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouis] r903 committed - Fix warnings in lou_trace - liblouis