From: SourceForge.net <no...@so...> - 2005-02-17 17:13:52
|
Bugs item #1124898, was opened at 2005-02-17 18:13 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 Category: MinGW Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: Dr. Bernhard Friedrichs (bfriedr) Assigned to: Earnie Boyd (earnie) Summary: ifstream.read() error Initial Comment: With gcc 3.3.1 and gcc 3.4.2 (both mingw) I get errors if: if (storagebits == 32) { for (i = 0; i < this->samples; i++ ) { ifs.read(static_cast<char *> (static_cast<void *>(&idata32)), sizeof( int)); ddata[i] = (double) (idata32 - adc_dcoffset) * lsbval * adc_factor; cout << i << " " << idata32 << " " << ddata[i] << " " << ifs.tellg() << endl; after reading around 300 binary 32 bit values (casted from char) I see that tellg() doe not increment with 4 bytes and the niumvbers I get are almost constant (ddata[i]). Ps.: The rouitine works fine since 3 years with linux (Suse 7.2, 8.2, 9.2) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 |
From: SourceForge.net <no...@so...> - 2005-02-17 18:43:41
|
Bugs item #1124898, was opened at 2005-02-17 12:13 Message generated for change (Settings changed) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 >Category: gcc Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: Dr. Bernhard Friedrichs (bfriedr) >Assigned to: Nobody/Anonymous (nobody) Summary: ifstream.read() error Initial Comment: With gcc 3.3.1 and gcc 3.4.2 (both mingw) I get errors if: if (storagebits == 32) { for (i = 0; i < this->samples; i++ ) { ifs.read(static_cast<char *> (static_cast<void *>(&idata32)), sizeof( int)); ddata[i] = (double) (idata32 - adc_dcoffset) * lsbval * adc_factor; cout << i << " " << idata32 << " " << ddata[i] << " " << ifs.tellg() << endl; after reading around 300 binary 32 bit values (casted from char) I see that tellg() doe not increment with 4 bytes and the niumvbers I get are almost constant (ddata[i]). Ps.: The rouitine works fine since 3 years with linux (Suse 7.2, 8.2, 9.2) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 |
From: SourceForge.net <no...@so...> - 2005-02-17 20:01:16
|
Bugs item #1124898, was opened at 2005-02-18 06:13 Message generated for change (Comment added) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 Category: gcc Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: Dr. Bernhard Friedrichs (bfriedr) Assigned to: Nobody/Anonymous (nobody) Summary: ifstream.read() error Initial Comment: With gcc 3.3.1 and gcc 3.4.2 (both mingw) I get errors if: if (storagebits == 32) { for (i = 0; i < this->samples; i++ ) { ifs.read(static_cast<char *> (static_cast<void *>(&idata32)), sizeof( int)); ddata[i] = (double) (idata32 - adc_dcoffset) * lsbval * adc_factor; cout << i << " " << idata32 << " " << ddata[i] << " " << ifs.tellg() << endl; after reading around 300 binary 32 bit values (casted from char) I see that tellg() doe not increment with 4 bytes and the niumvbers I get are almost constant (ddata[i]). Ps.: The rouitine works fine since 3 years with linux (Suse 7.2, 8.2, 9.2) ---------------------------------------------------------------------- >Comment By: Danny Smith (dannysmith) Date: 2005-02-18 09:01 Message: Logged In: YES user_id=11494 Was ifstream opened in binary mode rather than default text mode? In text mode, CTRLZ (0x1A) means EOF. If this isn't the problem, please provide a self-contained test case so that the problem can be reproduced. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 |
From: SourceForge.net <no...@so...> - 2005-02-18 09:46:41
|
Bugs item #1124898, was opened at 2005-02-17 18:13 Message generated for change (Comment added) made by bfriedr You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 Category: gcc Group: Known bugs Status: Open Resolution: None Priority: 5 Submitted By: Dr. Bernhard Friedrichs (bfriedr) Assigned to: Nobody/Anonymous (nobody) Summary: ifstream.read() error Initial Comment: With gcc 3.3.1 and gcc 3.4.2 (both mingw) I get errors if: if (storagebits == 32) { for (i = 0; i < this->samples; i++ ) { ifs.read(static_cast<char *> (static_cast<void *>(&idata32)), sizeof( int)); ddata[i] = (double) (idata32 - adc_dcoffset) * lsbval * adc_factor; cout << i << " " << idata32 << " " << ddata[i] << " " << ifs.tellg() << endl; after reading around 300 binary 32 bit values (casted from char) I see that tellg() doe not increment with 4 bytes and the niumvbers I get are almost constant (ddata[i]). Ps.: The rouitine works fine since 3 years with linux (Suse 7.2, 8.2, 9.2) ---------------------------------------------------------------------- >Comment By: Dr. Bernhard Friedrichs (bfriedr) Date: 2005-02-18 10:46 Message: Logged In: YES user_id=348733 Aha! It works fine now. So whyever linux does not care about the binary flag and also cygwin was working, mingw seems to be more precise. Thank you very much for your helpful comment. Regards, Bernhard ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-02-17 21:01 Message: Logged In: YES user_id=11494 Was ifstream opened in binary mode rather than default text mode? In text mode, CTRLZ (0x1A) means EOF. If this isn't the problem, please provide a self-contained test case so that the problem can be reproduced. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 |
From: SourceForge.net <no...@so...> - 2005-02-18 20:03:39
|
Bugs item #1124898, was opened at 2005-02-18 06:13 Message generated for change (Settings changed) made by dannysmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 Category: gcc Group: Known bugs >Status: Closed >Resolution: Works For Me Priority: 5 Submitted By: Dr. Bernhard Friedrichs (bfriedr) Assigned to: Nobody/Anonymous (nobody) Summary: ifstream.read() error Initial Comment: With gcc 3.3.1 and gcc 3.4.2 (both mingw) I get errors if: if (storagebits == 32) { for (i = 0; i < this->samples; i++ ) { ifs.read(static_cast<char *> (static_cast<void *>(&idata32)), sizeof( int)); ddata[i] = (double) (idata32 - adc_dcoffset) * lsbval * adc_factor; cout << i << " " << idata32 << " " << ddata[i] << " " << ifs.tellg() << endl; after reading around 300 binary 32 bit values (casted from char) I see that tellg() doe not increment with 4 bytes and the niumvbers I get are almost constant (ddata[i]). Ps.: The rouitine works fine since 3 years with linux (Suse 7.2, 8.2, 9.2) ---------------------------------------------------------------------- Comment By: Dr. Bernhard Friedrichs (bfriedr) Date: 2005-02-18 22:46 Message: Logged In: YES user_id=348733 Aha! It works fine now. So whyever linux does not care about the binary flag and also cygwin was working, mingw seems to be more precise. Thank you very much for your helpful comment. Regards, Bernhard ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2005-02-18 09:01 Message: Logged In: YES user_id=11494 Was ifstream opened in binary mode rather than default text mode? In text mode, CTRLZ (0x1A) means EOF. If this isn't the problem, please provide a self-contained test case so that the problem can be reproduced. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1124898&group_id=2435 |