Changeset 3012 for trunk/gsdl


Ignore:
Timestamp:
2002-02-27T12:01:31+13:00 (22 years ago)
Author:
jrm21
Message:

istream.get(char&) caused funny problems with gcc3 so they've been replaced
with char=istream.get() instead.

Location:
trunk/gsdl/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/lib/display.cpp

    r2965 r3012  
    2828/*
    2929   $Log$
     30   Revision 1.26  2002/02/26 23:01:31  jrm21
     31   istream.get(char&) caused funny problems with gcc3 so they've been replaced
     32   with char=istream.get() instead.
     33
    3034   Revision 1.25  2002/02/12 22:46:47  jrm21
    3135   Allow nested _If_ macros. We now count '(' and ')' characters, so you can now
     
    690694// bigendian should be set to 1
    691695// 0 will be returned when the end of the file has been found
    692 unsigned short my_uni_get (unistream &fin, int &line,
     696unsigned short my_uni_get (/*unistream*/ifstream &fin, int &line,
    693697               int &isunicode, int &bigendian) {
    694698  unsigned short c = 0;
     
    699703    unsigned char c1 = 0, c2 = 0;
    700704   
    701     if (!fin.eof()) fin.get(c1);
    702     if (!fin.eof()) fin.get(c2);
     705    if (!fin.eof()) c1=fin.get();
     706    if (!fin.eof()) c2=fin.get();
    703707    else c1 = 0;
    704708
     
    718722    unsigned char c1 = 0, c2 = 0, c3 = 0;
    719723    while (!fin.eof()) {
    720       fin.get(c1);
     724      c1=fin.get();
    721725      if (c1 == 0xfe || c1 == 0xff) {
    722726    // switch to unicode
    723727    isunicode = 1;
    724     if (!fin.eof()) fin.get(c2);
     728    if (!fin.eof()) c2=fin.get();
    725729
    726730    if (c1 == 0xff && c2 == 0xfe) bigendian = 0;
     
    737741      } else if (c1 >= 0xc0 && c1 <= 0xdf) {
    738742    // two byte character
    739     if (!fin.eof()) fin.get(c2);
     743    if (!fin.eof()) c2=fin.get();
    740744    c = ((c1 & 0x1f) << 6) + (c2 & 0x3f);
    741745    break;
     
    743747      } else if (c1 >= 0xe0 && c1 <= 0xef) {
    744748    // three byte character
    745     if (!fin.eof()) fin.get(c2);
    746     if (!fin.eof()) fin.get(c3);
     749    if (!fin.eof()) c2=fin.get();
     750    if (!fin.eof()) c3=fin.get();
    747751    c = ((c1 & 0xf) << 12) + ((c2 & 0x3f) << 6) + (c3 & 0x3f);
    748752    break;
     
    773777 
    774778  // open the file
    775   unistream fin (filenamestr);
     779  //  unistream fin (filenamestr);
     780  ifstream fin (filenamestr);
    776781
    777782  if (fin.fail()) return -1; // read failed
  • trunk/gsdl/lib/display.h

    r1310 r3012  
    6464
    6565#define unistream ifstream
    66 
    6766#else
    6867#  include <iostream>
Note: See TracChangeset for help on using the changeset viewer.