Commit Graph

58 Commits

Author SHA1 Message Date
f814dc5ff9 add checks after reading data 2022-01-22 17:06:28 -05:00
d854e58d00 add sanity check 2022-01-22 16:51:07 -05:00
3246fd62a7 size_t is unsigned, so can't be negative 2021-12-17 17:10:21 -05:00
a3a6077115 Use sfread and sfgets in reader_native.cpp 2021-12-17 17:03:58 -05:00
884dcbe4fa Refactor reader_native.cpp
- Use std::string instead of error-prone char buffers
- Limit reading files to known magic strings DUMPATOM and DUMPCUSTOM
2021-12-15 16:09:50 -05:00
902f9dd1fa Move allocation to correct location 2021-12-15 15:05:59 -05:00
3efddc4fb6 whitespace 2021-12-14 14:50:38 -05:00
5051055c76 Remove dead code and move nchunk read to read_header 2021-12-14 14:33:17 -05:00
80819f3793 reverse skip_buf with chunk 2021-12-14 11:09:36 -05:00
7c3deaa04b limit the skip buf to MAXSMALLINT 2021-12-13 23:03:10 -05:00
b1d0dd65ea simply the while loop and add correct initial m value 2021-12-13 22:57:39 -05:00
d4cec8ebe7 handle block reading in ReaderNative::read_atoms when binary is True 2021-12-13 21:38:16 -05:00
ff41864cd9 remove redundant deletes 2021-12-13 15:28:27 -05:00
cdc831bb89 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:23:30 -08:00
f3543a839e Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:23:21 -08:00
3eae7b4200 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:23:14 -08:00
af2e295ac2 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:22:57 -08:00
bb6d581ef8 Update src/reader_native.cpp
Co-authored-by: Richard Berger <richard.berger@temple.edu>
2021-12-13 12:22:39 -08:00
7db29112d8 replace read_buf to skip_buf in skip function 2021-12-12 00:26:55 -05:00
274b14618f fold match_fields() back into read_header() function 2021-12-11 21:17:41 -05:00
0603dc6323 whitespace 2021-12-11 20:46:24 -05:00
56fd07d88e fold native binary reader class in to native reader class 2021-12-11 20:31:44 -05:00
8f99d8d1d9 fix skip bugs 2021-12-11 16:41:13 -05:00
250a5921a3 move match_field to protected method and format the docstring 2021-12-11 14:25:29 -05:00
7ab5d4edd4 add new ReaderNativeBin class 2021-12-11 11:54:21 -05:00
09c19a936b update URLs in source code and manual 2021-05-24 14:18:20 -04:00
d1941392d3 disable clang-format for all existing .cpp files (for now) 2021-05-05 23:53:38 -04:00
51a20175c9 more code formatting consistency changes for loops and conditionals 2020-12-30 09:47:45 -05:00
382ade15fe more consistent formatting of for/while loops and if statements 2020-12-30 09:09:08 -05:00
adf74b3a22 use https://lammps.sandia.gov based URLs consistently 2020-10-21 16:45:30 -04:00
29a7d598ac update formatting style to be more consistent 2020-09-21 02:04:58 -04:00
f1ef7d85a8 T2345: Replace instances of NULL with nullptr
The following changes have been applied to src and lib folders:
regex replace: ([^"_])NULL ⇒ \1nullptr (8968 chgs in src, 1153 in lib)
Manually find/change: (void \*) nullptr ⇒ nullptr (1 case)
regex find: ".*?nullptr.*?"
  Manually ~14 cases back to "NULL" in src, ~2 in lib
  regex finds a few false positive where nullptr appears between two
  strings in a function call
2020-09-12 09:34:38 -06:00
390c6ba106 rechecking some corefiles with IWYU after the many updates 2020-09-03 15:28:07 -04:00
55704368d0 include updates for commonly used packages 2020-09-03 01:45:05 -04:00
c7c4297cfc update include handling for commands 2020-09-03 00:51:58 -04:00
a4a1f7e848 more IWYU cleanup 2020-09-02 23:49:17 -04:00
27b4e93bf5 silence compiler warnings 2020-08-29 18:32:21 -04:00
7d8dcb0fb0 Remove strtok from reader_native.cpp 2020-08-10 15:56:06 -04:00
9291d2a9d7 Simplify count_words, add trim_and_count_words
The original count_words function (before it was put into utils::) also trimmed
comments. For compatibility this behaviour was retained at first. However, due
to the name the trimming is not immediatly apparent and many times not
wanted.

Therefore, this commit replaces count_words with an implementation that
just does what it says. If a comment should be trimmed there is a
trim_comment function. For convenience, a trim_and_count_words function was
added and is now used where the old behaviour was needed.
2020-06-04 11:13:37 -04:00
4a2d3e95cb Replace Atom::count_words with utils::count_words 2020-05-20 15:53:19 -04:00
07c5adc57a we need more specific matches to correctly handle TIME and TIMESTEP items 2020-02-14 16:07:34 -05:00
7c62bce7d9 Enable reading dump file with ITEM:TIME 2020-02-13 18:13:22 +01:00
b6b022b610 whitespace cleanup: remove trailing blanks 2019-11-03 11:03:39 -05:00
be38ef0eb0 make native dump reader compatible with dump files containing ITEM: UNITS 2019-09-12 15:26:02 -04:00
a50d57bceb Merge branch 'master' into improve-include-consistency
# Conflicts:
#	src/utils.cpp
2019-07-19 17:57:58 -04:00
8526e7a4cd checking return value of ?scanf() calls to detect problems parsing files 2019-07-19 11:14:39 -04:00
06dcc9e283 Merge branch 'master' into improve-include-consistency
# Conflicts:
#	src/USER-MESO/atom_vec_tdpd.cpp
2019-07-09 14:50:00 -04:00
74414afdea Added the boxinfo argument 2019-07-08 17:25:23 -06:00
256531a29a put implementation header first for all remaining main folder source files 2019-07-03 19:34:13 -04:00
e4071d7f46 replace C-style include files with their C++ equivalents 2018-04-27 18:00:24 -04:00