diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-02-13 19:02:23 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-02-13 19:02:23 +0000 |
| commit | 47d871e0b2a9ed5fb58d4d02edf840a0d4b19783 (patch) | |
| tree | 4267c803d47dcc1852b51e6f9b622535e1d2d9d0 /src/io | |
| parent | Build. Adding unistd header (fixes compilation on Win32 with OpenSuse cross-c... (diff) | |
| download | inkscape-47d871e0b2a9ed5fb58d4d02edf840a0d4b19783.tar.gz inkscape-47d871e0b2a9ed5fb58d4d02edf840a0d4b19783.zip | |
fixing variable type in stream classes to what was intended (preparation for solving bug #1120585 )
(bzr r12123)
Diffstat (limited to 'src/io')
| -rw-r--r-- | src/io/inkscapestream.cpp | 10 | ||||
| -rw-r--r-- | src/io/inkscapestream.h | 6 | ||||
| -rw-r--r-- | src/io/stringstream.cpp | 5 | ||||
| -rw-r--r-- | src/io/stringstream.h | 2 | ||||
| -rw-r--r-- | src/io/uristream.cpp | 15 | ||||
| -rw-r--r-- | src/io/uristream.h | 2 |
6 files changed, 15 insertions, 25 deletions
diff --git a/src/io/inkscapestream.cpp b/src/io/inkscapestream.cpp index 65f24cf59..3270127d6 100644 --- a/src/io/inkscapestream.cpp +++ b/src/io/inkscapestream.cpp @@ -125,7 +125,7 @@ void BasicOutputStream::flush() /** * Writes the specified byte to this output stream. */ -void BasicOutputStream::put(int ch) +void BasicOutputStream::put(gunichar ch) { if (closed) return; @@ -775,9 +775,7 @@ void OutputStreamWriter::flush() */ void OutputStreamWriter::put(gunichar ch) { - //Do we need conversions here? - int intCh = (int) ch; - outputStream.put(intCh); + outputStream.put(ch); } //######################################################################### @@ -827,9 +825,7 @@ void StdWriter::flush() */ void StdWriter::put(gunichar ch) { - //Do we need conversions here? - int intCh = (int) ch; - outputStream->put(intCh); + outputStream->put(ch); } diff --git a/src/io/inkscapestream.h b/src/io/inkscapestream.h index 37c41552f..a9854ae6d 100644 --- a/src/io/inkscapestream.h +++ b/src/io/inkscapestream.h @@ -189,7 +189,7 @@ public: /** * Send one byte to the destination stream. */ - virtual void put(int ch) = 0; + virtual void put(gunichar ch) = 0; }; // class OutputStream @@ -212,7 +212,7 @@ public: virtual void flush(); - virtual void put(int ch); + virtual void put(gunichar ch); protected: @@ -238,7 +238,7 @@ public: void flush() { } - void put(int ch) + void put(gunichar ch) { putchar(ch); } }; diff --git a/src/io/stringstream.cpp b/src/io/stringstream.cpp index 44d11dd04..f204a99d5 100644 --- a/src/io/stringstream.cpp +++ b/src/io/stringstream.cpp @@ -112,10 +112,9 @@ void StringOutputStream::flush() /** * Writes the specified byte to this output stream. */ -void StringOutputStream::put(int ch) +void StringOutputStream::put(gunichar ch) { - gunichar uch = (gunichar)ch; - buffer.push_back(uch); + buffer.push_back(ch); } diff --git a/src/io/stringstream.h b/src/io/stringstream.h index 4a05d88a9..a78935599 100644 --- a/src/io/stringstream.h +++ b/src/io/stringstream.h @@ -67,7 +67,7 @@ public: virtual void flush(); - virtual void put(int ch); + virtual void put(gunichar ch); virtual Glib::ustring &getString() { return buffer; } diff --git a/src/io/uristream.cpp b/src/io/uristream.cpp index 19994bc82..8d7fd9b38 100644 --- a/src/io/uristream.cpp +++ b/src/io/uristream.cpp @@ -402,16 +402,14 @@ void UriOutputStream::flush() throw(StreamException) /** * Writes the specified byte to this output stream. */ -void UriOutputStream::put(int ch) throw(StreamException) +void UriOutputStream::put(gunichar ch) throw(StreamException) { if (closed) return; unsigned char uch; - gunichar gch; switch (scheme) { - case SCHEME_FILE: if (!outf) return; @@ -420,13 +418,11 @@ void UriOutputStream::put(int ch) throw(StreamException) Glib::ustring err = "ERROR writing to file "; throw StreamException(err); } - //fwrite(uch, 1, 1, outf); - break; + break; case SCHEME_DATA: - gch = (gunichar) ch; - data.push_back(gch); - break; + data.push_back(ch); + break; }//switch @@ -474,8 +470,7 @@ void UriWriter::flush() throw(StreamException) */ void UriWriter::put(gunichar ch) throw(StreamException) { - int ich = (int)ch; - outputStream->put(ich); + outputStream->put(ch); } diff --git a/src/io/uristream.h b/src/io/uristream.h index 16b1b0894..e519335e8 100644 --- a/src/io/uristream.h +++ b/src/io/uristream.h @@ -115,7 +115,7 @@ public: virtual void flush() throw(StreamException); - virtual void put(int ch) throw(StreamException); + virtual void put(gunichar ch) throw(StreamException); private: |
