Commit graph

2126 commits

Author SHA1 Message Date
Jeff Epler
84472921c1 Don't open part 21 files as text files
On Windows, when a file is opened in "text" mode, but it actually
contains Unix-style line endings, the behavior of tellg() is
unexpected.

Consider this program which puts the (binary) contents "a\nb\n" in a
file, then opens it in text mode for reading.  It prints each
character read, along with the value returned by tellg():

    #include <iostream>
    #include <fstream>

    int main()
    {
        {
            std::ofstream f("myfile.txt", std::ios::binary);
            f << "a\nb\n";
        }

        std::ifstream f("myfile.txt");

        for (char c=0; f.get(c);)
            std::cout << f.tellg() << ' ' << int(c) << '\n';
    }

On a UNIX platform which does not have a distinction between "text"
and "binary" files, the output will read
    1 97
    2 10
    3 98
    4 10
because the file position simply advances one position after each
byte is read.

On Windows with the Visual Studio C and C++ runtime, the result is
instead
    -1 97
    1 10
    2 98
    4 10
While it is impossible to say exactly what the Windows runtime is
doing here, it appears that it is trying to adjust for the mismatch
between "number of bytes read in byte oriented mode and "number of
bytes read in text mode".

Since "part21" files don't necessarily contain CRLF line endings
when viewed in binary mode, open the file in binary mode.  This
fixes the test failure seen on appveyor ci running the
"test_inverse_attr3" test.
2017-08-21 17:11:50 -05:00
Mark
a96336ab97 Merge pull request #351 from stepcode/review/327
Review/327
2017-08-13 20:46:34 -04:00
Thomas Paviot
b24680d7e5 Merge pull request #356 from luzpaz/ascii-typos
Fixed typos showing up as ascii chars
2017-03-05 07:41:13 +01:00
Kunda
15afe96d67 Fixed typos showing up as ascii chars
Using http://www.lisi.ensma.fr/ftp/enseignement/A3_Master_Ingenierie_donnees/fonctionsGrammaire_EXPRESS.pdf I was able to fix typos in the text files for Builtin.py
2017-03-04 07:22:46 -05:00
Cliff Yapp
a78ca01b54 Revert "Get latest version of ap242 from http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap242_managed_model_based_3d_engineering/mim_lf.exp"
This reverts commit 0b456a833e.

New schema apparently doesn't build.
2016-08-06 16:51:58 -04:00
Cliff Yapp
8627627c5e Add an option to completely bypass the git management of the version header. 2016-08-06 13:53:12 -04:00
Cliff Yapp
9b091756b1 Allow the user to control whether C++11 is used (matters for subbuilds) 2016-08-06 13:02:35 -04:00
Cliff Yapp
dfce2dcf07 For the flags variables, rather annoyingly, they actually need to be managed as strings and not lists. 2016-08-06 12:37:01 -04:00
Cliff Yapp
5c7e63c75b Fix macro comments. This approach to managing the targets varies from the old EXCLUDE_OR_INSTALL setup in that by default the testable targets are not added to the 'all' build - in other works, 'make' will make just the main stepcode targets. The testable targets are available individually, and if SC_ENABLE_TESTING is enabled they *will* be added to the 'all' target, but by default they are not compiled in the basic build. 2016-08-06 12:32:12 -04:00
Cliff Yapp
0b456a833e Get latest version of ap242 from http://stepmod.cvs.sourceforge.net/viewvc/stepmod/stepmod/data/modules/ap242_managed_model_based_3d_engineering/mim_lf.exp 2016-08-06 12:05:18 -04:00
Cliff Yapp
a243b4d8c8 Separate shared and static generated files for better parallel building safety. 2016-08-06 11:55:38 -04:00
Cliff Yapp
daec3e2640 Add option handling to the SC target macros, replacing the EXCLUDE_FROM_INSTALL macro. 2016-08-06 11:43:59 -04:00
Cliff Yapp
06b13bb9af Make a stab at adapting the new, simplier verification to vanilla stepcode 2016-08-06 11:23:34 -04:00
Cliff Yapp
e38519a7f1 Update Find cmake scripts 2016-08-06 10:53:19 -04:00
Cliff Yapp
12def15dd2 Start working on merging BRL-CAD changes back into upstream. 2016-08-06 10:46:23 -04:00
Mark Pictor
a160cc9af6 fix #327 - statically initialize t_sdaiINTEGER etc 2015-08-30 11:57:58 -04:00
Mark Pictor
1dfe76b3b4 README: put CI badges in table 2015-08-23 22:30:36 -04:00
Mark Pictor
c23ba65c41 appveyor log - use JSON-like console data, massaged for parsability 2015-08-23 22:30:16 -04:00
Mark Pictor
274de2a91d appveyor: exclude hanging test 2015-08-10 21:06:51 -04:00
Mark Pictor
1a757024c4 add appveyor badge 2015-08-10 21:04:10 -04:00
Mark Pictor
abae0a7c45 allow downloading log directly from AV 2015-08-10 21:00:35 -04:00
Mark
bfc11face5 Merge pull request #345 from stepcode/review/misc
appveyor isn't at 100%, but it's considerably better
2015-08-10 20:47:30 -04:00
Mark Pictor
677261d4fb fix LNK2004 getEDesc already defined in sectionReader.obj
is this really the only/best way to fix this?!
2015-08-09 23:36:54 -04:00
Mark Pictor
4207a46f07 fix MSVC link error for NilSTEPentity 2015-08-09 23:30:13 -04:00
Mark Pictor
7316fe5070 msvc warnings/errors 2015-08-09 23:29:15 -04:00
Mark Pictor
4d32009592 'register' storage class specifier is deprecated [-Wdeprecated-register] 2015-08-03 22:00:22 -04:00
Mark Pictor
0b6078b72b missing include 2015-08-03 21:55:00 -04:00
Mark Pictor
36e34862cc cllazyfile: work around LNK2005 error. had to tweak class members so MSVC didn't see MgrNodeBase class twice.
suspect there is a better solution, but I'm not sure what it would be
2015-08-03 21:50:19 -04:00
Mark Pictor
9dcb6aa640 build judy array as part of base lib, else import/export macros don't work 2015-08-03 21:38:37 -04:00
Mark Pictor
bc5533bda8 test for, and use, nullptr if we have it 2015-08-03 21:37:28 -04:00
Mark Pictor
4e88ad69eb summarize-appveyor-log: sort before printing 2015-08-02 22:51:22 -04:00
Mark Pictor
b890c156f5 attempt to silence msvc linker errors 2015-08-02 22:50:26 -04:00
Mark Pictor
0ba7343004 no more excuses, build cllazyfile on windows 2015-08-02 15:59:48 -04:00
Mark Pictor
f2247d222f use COMPILE_DEFINITIONS property for definitions 2015-08-02 15:58:04 -04:00
Mark Pictor
5288026043 add windows dll import/export macros to cllazyfile 2015-08-02 15:57:10 -04:00
Mark Pictor
6e8cad223e cmake 2.8.7 needs append_string, not append 2015-08-02 15:37:45 -04:00
Mark Pictor
018e7cfffc reduce delay used in parallel test, as it appears to cause a failure.
TODO: rework the test to not be timing-sensitive
2015-08-02 14:53:36 -04:00
Mark Pictor
458b775f41 simplify cmake logic - use set_property(...APPEND...) rather than get/list append/set 2015-08-02 14:30:01 -04:00
Mark Pictor
dc82923cf1 support cmake 2.8.7 since that's what travis-ci uses 2015-08-02 14:28:53 -04:00
Mark Pictor
aa967b3316 tweak includ dir logic, print path 2015-07-26 23:22:32 -04:00
Mark Pictor
17b41da525 add std::chrono test, if available use in thread test 2015-07-26 22:22:44 -04:00
Mark Pictor
135adc76c8 fix warning, improve cmake messages 2015-07-26 20:49:04 -04:00
Mark Pictor
017faa942f make schema-specific tests work on cmake 3.x 2015-07-26 20:49:04 -04:00
Mark Pictor
46c37207da replace c++ style comments recently introduced with c-style comments 2015-07-26 16:59:42 -04:00
Mark Pictor
85f45f38e4 debug message for appveyor 2015-07-26 15:22:24 -04:00
Mark Pictor
be378119f4 piping to grep prevents appveyor from detecting failures 2015-07-26 15:22:09 -04:00
Mark Pictor
ecde882d5a oops, forgot export macro for path2str 2015-07-26 14:32:43 -04:00
Mark Pictor
3d90ffdf83 remove yet more CORBA and ObjectStore stuff... surprised it still exists 2015-07-26 14:22:07 -04:00
Mark Pictor
5dfca2ed78 exp2py - remove unused function USEREFout 2015-07-26 14:20:24 -04:00
Mark Pictor
fbf0272d3b indent a listdo/listod 2015-07-26 13:42:52 -04:00