tags 560476 + patch
retitle 560476 singular: [PATCH] FTBFS: febase.cc:752: error: invalid 
conversion from 'const char*' to 'char*'
thanks

See attached patch for the previous FTBFS error, but the compiling
following which is not straightforward for fix. See marked ">>". Hope this
will help further to resolve the problem.

Jari

    mpr_complex.cc: In member function 'void gmp_float::setFromStr(const 
char*)':
    mpr_complex.cc:85: error: invalid conversion from 'const char*' to 'char*'

     80 void gmp_float::setFromStr(const char * in )
     81 {
     82   BOOLEAN neg=false;
     83   if (*in == '-') { in++; neg=TRUE; }
     84   char *s;
     85   if ((s=strchr(in,'E')) !=NULL)
     86   {
>>   87     *s='e';
     88   }
     89 
     90   // gmp doesn't understand number which begin with "." -- it needs 0.
     91   // so, insert the zero
     92   if (*in == '.')
     93   {
     94     int len = strlen(in)+2;
     95     char* c_in = (char*) omAlloc(len);
     96     *c_in = '0';
     97     strcpy(&(c_in[1]), in);
     98 
     99     mpf_set_str( t, c_in, 10 );
    100     omFreeSize((void*)c_in, len);
    101   }
    102   else
    103   {
    104     mpf_set_str( t, in, 10 );
    105   }
    106   if (neg)  mpf_neg( t, t );
    107 }


>From 7e5e44df388bea8f1eb79b1a439ace5807d55dac Mon Sep 17 00:00:00 2001
From: Jari Aalto <jari.aa...@cante.net>
Date: Fri, 8 Jan 2010 14:02:59 +0200
Subject: [PATCH] Fix Gcc 4.4 error: invalid conversion from const char* to char*

Signed-off-by: Jari Aalto <jari.aa...@cante.net>
---
 kernel/febase.cc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/febase.cc b/kernel/febase.cc
index 359664c..a41d1e3 100644
--- a/kernel/febase.cc
+++ b/kernel/febase.cc
@@ -743,13 +743,13 @@ FILE * feFopen(const char *path, const char *mode, char *where,
       char* dir_sep;
       struct passwd *pw_entry;
       strcpy (longpath, path);
-      dir_sep = strchr(longpath, DIR_SEP);
+      dir_sep = (char *) strchr(longpath, DIR_SEP);
       *dir_sep = '\0';
       pw_entry = getpwnam(&longpath[1]);
       if (pw_entry != NULL)
       {
         strcpy(longpath, pw_entry->pw_dir);
-        dir_sep = strchr(path, DIR_SEP);
+        dir_sep =(char *) strchr(path, DIR_SEP);
         strcat(longpath, dir_sep);
         path = longpath;
       }
-- 
1.6.5

Reply via email to