From bug-octave-request at bevo dot che dot wisc dot edu Sun Nov 7 12:36:30 1999 Subject: Casting from (const char *) to (char *) in liboctave/oct-... From: "PETER HOPFGARTNER" To: Date: Fri, 05 Nov 1999 17:55:50 +0100 --simple boundary Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Description: "cc:Mail Note Part" Subject: Casting from (const char *) to (char *) in liboctave/oct-time.cc --------------------------------- On Digital Unix 4.0c, gcc-2.95.2, octave-2.1.20, compilation stops at liboctave/oct-time.cc since a pointer to a const char (string.c_str) is passed to a pointer to a char (tm.tm_zone). The attached patch is a quick and dirty solution, that simply inserts 2 casts. peter (See attached file: oct-time.cc.diff) --simple boundary Content-Type: text/plain; charset=US-ASCII; name="oct-time.cc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="oct-time.cc.diff" --- oct-time.cc.orig Fri Nov 5 11:52:25 1999 +++ oct-time.cc Fri Nov 5 16:25:34 1999 at @ -47,7 +47,7 @@ #if defined (HAVE_TM_ZONE) string s = tm.zone (); - t.tm_zone = s.c_str (); + t.tm_zone = (char *) s.c_str (); #endif ot_unix_time = mktime (&t); at @ -138,7 +138,7 @@ t.tm_isdst = tm_isdst; #if defined (HAVE_TM_ZONE) - t.tm_zone = tm_zone.c_str (); + t.tm_zone = (char *) tm_zone.c_str (); #endif const char *fmt_str = fmt.c_str (); --simple boundary-- --------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. To ensure that development continues, see www.che.wisc.edu/octave/giftform.html Instructions for unsubscribing: www.che.wisc.edu/octave/archive.html ---------------------------------------------------------------------