Skip to content

Commit abf6977

Browse files
committed
Release v2.9
Squashed commit of the following: commit 3961129 Author: astand <ast.and@bk.ru> Date: Fri Jan 27 22:28:17 2023 +0100 Refactored ptr_double. commit 1f47c93 Author: astand <ast.and@bk.ru> Date: Fri Jan 27 22:20:20 2023 +0100 Build fixes (v2.8). commit 5648e4a Author: Alex Ch <axch@mail.ru> Date: Wed Jan 25 21:04:58 2023 +0300 prt_double fix (#21) * prt_double fix (for e.g. '-20.47') * generator updated * Styling and doxy fixes * astyle script corrected * RELEASES file updated * Rebased with master * DBC line test fixed Co-authored-by: Alexey Chernobaev <aachernobaev@sberautotech.ru> commit 286b76c Author: astand <ast.and@bk.ru> Date: Wed Jan 18 20:58:10 2023 +0100 Style script handles 'src' directory only commit 17218df Author: astand <ast.and@bk.ru> Date: Tue Jan 17 22:17:07 2023 +0100 Fixed bug in prt_double commit b89d2ee Author: astand <ast.and@bk.ru> Date: Sun Jan 15 14:55:58 2023 +0100 Fixed floating parsing, better printing, removed duplication. commit d63b36a Author: astand <ast.and@bk.ru> Date: Thu Sep 29 22:40:32 2022 +0300 Fixed long line reading from istream. commit 9fbe4fd Author: Astakhov Andrey <ast.and@bk.ru> Date: Tue Jul 26 22:51:21 2022 +0300 New monitor impl (#14) * Added build configuration for generated files. * Hash and SysTick monitor function wrapped to macros. * Release editing. App version printing. commit 5504578 Merge: 4c4bf72 f93b297 Author: Astakhov Andrey <ast.and@bk.ru> Date: Sun Jul 24 23:45:28 2022 +0300 Merge pull request #13 from astand/gen-options Optional sources generation commit f93b297 Author: astand <ast.and@bk.ru> Date: Sun Jul 24 23:44:55 2022 +0300 Update release notes. commit d95209a Author: astand <ast.and@bk.ru> Date: Sun Jul 24 23:37:24 2022 +0300 Fixed astyle script. commit 630e4eb Author: astand <ast.and@bk.ru> Date: Sun Jul 24 23:36:15 2022 +0300 Added script to remove all generated code. commit aad15d4 Author: astand <ast.and@bk.ru> Date: Sun Jul 24 23:36:01 2022 +0300 Added option to disable some sources generation. commit 54ff5c0 Author: astand <ast.and@bk.ru> Date: Sun Jul 24 23:01:27 2022 +0300 Extended bitext test. commit f8848a3 Author: astand <ast.and@bk.ru> Date: Sat Jul 23 21:28:19 2022 +0300 Removed unuseful things. commit c05ee54 Author: astand <ast.and@bk.ru> Date: Sat Jul 23 17:12:25 2022 +0300 Added versions to FS gen config. commit 2ae8673 Author: astand <ast.and@bk.ru> Date: Sat Jul 23 16:52:47 2022 +0300 Removed overhead in fs-creator. commit 792423e Author: astand <ast.and@bk.ru> Date: Sat Jul 23 16:33:24 2022 +0300 Added tests for bitext function (from gen code). commit e0b0d41 Author: astand <ast.and@bk.ru> Date: Sat Jul 23 15:49:46 2022 +0300 Small enhancement, commit 0f95aae Author: astand <ast.and@bk.ru> Date: Thu Jul 21 22:19:26 2022 +0300 Tests updated. commit e3d732f Author: astand <ast.and@bk.ru> Date: Thu Jul 21 22:06:31 2022 +0300 New config in new config parser class. commit 92d1b94 Author: astand <ast.and@bk.ru> Date: Wed Jul 20 23:39:22 2022 +0300 Arguments parsing in separated class. commit b6cb000 Author: astand <ast.and@bk.ru> Date: Tue Jul 19 11:39:31 2022 +0300 New generation options are introduced in help message. commit 4c4bf72 Author: astand <ast.and@bk.ru> Date: Wed Jul 20 00:16:42 2022 +0300 Added GTEST support. commit 677efdf Merge: f986286 322becf Author: Astakhov Andrey <ast.and@bk.ru> Date: Tue Jul 19 11:04:37 2022 +0300 Merge pull request #12 from astand/fix-opt Structural refactoring and changes in fmon-* source code for making fmon-* driver's support a bit easier. commit 322becf Author: astand <ast.and@bk.ru> Date: Sat Jul 2 21:05:09 2022 +0300 Updates in fmon-* source code, some inner optimizations etc. Some service level improvements. New fmon generator and fmon model. Config section for MONO fmon mode. FS splitted to gen and file settings. Direct appending to fwriter. Removed useless methods. FileWriter API update. Mon generator with new FWriter API. Update in FWriter API. All users use new API. Added main header with empty lines in comments of some signals. Ignore vscode config. Driver compilation config printer as separated driver. AStyle format to all sources. Update realese notes. commit f986286 Merge: 9100dba 2e104d4 Author: Astakhov Andrey <ast.and@bk.ru> Date: Sat May 7 21:05:08 2022 +0300 Merge pull request #10 from astand/valtables Issue#9 and other things commit 2e104d4 Author: astand <ast.and@bk.ru> Date: Sat May 7 21:01:06 2022 +0300 Config update for windows using. commit 6fbb51b Author: astand <ast.and@bk.ru> Date: Sat May 7 21:00:48 2022 +0300 Fixed incompleted square brakets migration. commit 3319138 Author: astand <ast.and@bk.ru> Date: Sat May 7 20:52:09 2022 +0300 Release notes editing. commit 4c13d07 Author: astand <ast.and@bk.ru> Date: Sat May 7 20:29:07 2022 +0300 Test DBC generation with square brakets includes. commit dcce732 Author: astand <ast.and@bk.ru> Date: Sat May 7 20:28:45 2022 +0300 Files which is presumed to be in __include__ in square brackets. commit 1d163c6 Author: astand <ast.and@bk.ru> Date: Sat May 7 13:21:25 2022 +0300 WTF was that? commit 500427f Author: astand <ast.and@bk.ru> Date: Sat May 7 13:21:07 2022 +0300 Minor style change. commit a14407a Author: astand <ast.and@bk.ru> Date: Sat May 7 13:20:28 2022 +0300 Added test on binutil souce code version (compare with main lib). commit 556c072 Author: astand <ast.and@bk.ru> Date: Sat May 7 12:44:32 2022 +0300 Added test on source code versions (main driver h/c). commit 739870b Author: astand <ast.and@bk.ru> Date: Sat May 7 12:17:55 2022 +0300 Remove extra empty comment line generation. commit 230933f Author: astand <ast.and@bk.ru> Date: Sat May 7 12:07:25 2022 +0300 Minor improvement in signal's info comments. commit e4fd53f Author: astand <ast.and@bk.ru> Date: Sat May 7 11:58:10 2022 +0300 Added more info about sign extending function. commit 013b993 Author: astand <ast.and@bk.ru> Date: Sat May 7 11:57:55 2022 +0300 Test DBC with new val table macros generated. commit 6661cdd Author: astand <ast.and@bk.ru> Date: Sat May 7 11:02:17 2022 +0300 Added value table's macros printing to main driver header. commit 961c15b Author: astand <ast.and@bk.ru> Date: Sat May 7 11:01:19 2022 +0300 Added more specific value tables handling. commit cb9137e Author: astand <ast.and@bk.ru> Date: Fri May 6 22:42:51 2022 +0300 Main dbc driver name stripped by C-name checker. commit 3eff250 Author: astand <ast.and@bk.ru> Date: Fri May 6 22:41:47 2022 +0300 Added helper for valid C-identifier stripper. commit 9100dba Author: astand <ast.and@bk.ru> Date: Fri Mar 11 23:10:16 2022 +0300 Removed unused line. commit 323d2a8 Author: astand <ast.and@bk.ru> Date: Fri Mar 11 23:06:29 2022 +0300 Added test DBC CAN matrix and generation scripts. commit 45209db Author: astand <ast.and@bk.ru> Date: Fri Mar 11 22:50:17 2022 +0300 Gitignore and gitattribute unused content removed. commit 75b5813 Author: astand <ast.and@bk.ru> Date: Sat Feb 19 23:21:41 2022 +0300 Changelog editing. commit 634b4b7 Author: astand <ast.and@bk.ru> Date: Sat Feb 19 23:17:11 2022 +0300 Added signature extension for signed signal types. commit ad43ded Author: astand <ast.and@bk.ru> Date: Sat Feb 19 23:16:34 2022 +0300 Target signals type selection optimized. commit 83d894d Author: astand <ast.and@bk.ru> Date: Wed Feb 2 16:10:35 2022 +0300 Updated docs. commit bdef03c Author: astand <ast.and@bk.ru> Date: Wed Feb 2 11:25:02 2022 +0300 Minor fixes. commit b29a47a Author: astand <ast.and@bk.ru> Date: Wed Feb 2 11:18:16 2022 +0300 Version update (v2.0). commit f470bbc Author: astand <ast.and@bk.ru> Date: Wed Feb 2 11:18:09 2022 +0300 Change way of passing calling arguments. commit 7d42aec Author: astand <ast.and@bk.ru> Date: Wed Feb 2 09:28:07 2022 +0300 Explicit cast from int64 to uint32. commit 196b17d Author: astand <ast.and@bk.ru> Date: Wed Feb 2 00:02:39 2022 +0300 Fixed error in with bitutil wrong dir generation. commit 770bb9b Author: astand <ast.and@bk.ru> Date: Tue Feb 1 22:15:23 2022 +0300 Added filter for local test infrustructure. commit 57f3863 Author: astand <ast.and@bk.ru> Date: Tue Feb 1 22:15:04 2022 +0300 Simple fix problem with too long lines. commit 5d9a5a7 Author: astand <ast.and@bk.ru> Date: Mon Jan 24 11:37:19 2022 +0300 Changelog editing. commit d199361 Author: astand <ast.and@bk.ru> Date: Mon Jan 17 21:50:24 2022 +0300 Added astyle bin and format script. commit 8526c87 Author: astand <ast.and@bk.ru> Date: Mon Jan 17 09:11:02 2022 +0300 Enhanced directory structure for generated files. commit ebe6786 Author: astand <ast.and@bk.ru> Date: Fri Dec 17 23:32:32 2021 +0300 Fixed extra line for ValTable parsed lines. commit f80fb2a Author: Astakhov Andrey <quater873@gmail.com> Date: Tue Nov 9 21:50:22 2021 +0300 Update README.md commit 25eae41 Author: Astakhov Andrey <quater873@gmail.com> Date: Tue Nov 9 14:45:37 2021 +0300 Update README.md commit 4e3f22f Author: astand <ast.and@bk.ru> Date: Tue Nov 9 13:58:23 2021 +0300 Updated readme. commit 2938aa6 Author: astand <ast.and@bk.ru> Date: Tue Nov 9 10:14:23 2021 +0300 Releases updated for v1.9. commit 3d3605f Author: astand <ast.and@bk.ru> Date: Tue Nov 9 09:43:55 2021 +0300 All sources processed by code style tool. commit 2f22c2e Author: astand <ast.and@bk.ru> Date: Tue Nov 9 09:40:12 2021 +0300 Fixed: closing comment in -config.h, minor code style. commit 3b6b7bc Author: astand <ast.and@bk.ru> Date: Mon Nov 1 22:14:28 2021 +0300 Release updated for v1.8. commit 906b274 Author: astand <ast.and@bk.ru> Date: Mon Oct 25 20:58:58 2021 +0300 Fixed wrong way of rewriting CSM signal. commit 48556b3 Author: astand <ast.and@bk.ru> Date: Sun Oct 10 21:35:48 2021 +0300 Releases updated for v1.7. commit c5bbd7f Author: astand <ast.and@bk.ru> Date: Sun Oct 10 21:32:55 2021 +0300 Added suppot for multi Transmiters. commit 02d1e28 Author: astand <ast.and@bk.ru> Date: Sun Oct 10 21:31:36 2021 +0300 Fixed potential bug. Missing node adding on RecS item matching. commit 9af49b0 Author: astand <ast.and@bk.ru> Date: Sun Oct 10 21:30:01 2021 +0300 Changes on style guide. commit a2c0079 Author: astand <ast.and@bk.ru> Date: Thu Sep 9 22:50:54 2021 +0300 Releases updated for v1.6. commit f918d01 Author: astand <ast.and@bk.ru> Date: Thu Sep 9 22:45:43 2021 +0300 Fixed issue with 1 frame in RX struct. commit 6439bcc Author: astand <ast.and@bk.ru> Date: Wed Sep 8 23:19:21 2021 +0300 Added optional binutil generation for each node in DBC. commit 6481e7e Author: astand <ast.and@bk.ru> Date: Thu Aug 26 23:38:09 2021 +0300 Fixed some issues. commit 75f0193 Author: astand <quater873@gmail.com> Date: Tue Jul 13 21:56:13 2021 +0300 Removed test info. Edited README.md. commit ff67c1f Author: astand <ast.and@bk.ru> Date: Sun Jul 11 22:07:48 2021 +0300 Hotfixed README layout. commit 002c86b Author: astand <ast.and@bk.ru> Date: Sun Jul 11 22:04:23 2021 +0300 v1.3 commit 2ba501e Author: astand <ast.and@bk.ru> Date: Sun Jul 11 22:04:10 2021 +0300 Added template file generation. Refactored config comment text. commit f604b88 Author: astand <ast.and@bk.ru> Date: Sun Jul 11 17:59:17 2021 +0300 Readme updated. commit e7a4cab Author: astand <ast.and@bk.ru> Date: Sun Jul 11 13:19:53 2021 +0300 v1.2 commit 0ad29f6 Author: astand <ast.and@bk.ru> Date: Sun Jul 11 13:19:39 2021 +0300 Added LICENSE and README. commit 0628848 Author: astand <ast.and@bk.ru> Date: Sun Jul 11 13:18:20 2021 +0300 Improved help message text. commit 64745a1 Author: astand <ast.and@bk.ru> Date: Sun Jul 11 12:20:54 2021 +0300 Application executable name changed - coderdbc. commit 3376c58 Author: astand <ast.and@bk.ru> Date: Sat Jul 10 17:10:18 2021 +0300 Fixed type casting warning. commit 84601a9 Author: astand <ast.and@bk.ru> Date: Sat Jul 10 17:05:18 2021 +0300 Removed useless files and settings. commit 359da55 Author: astand <ast.and@bk.ru> Date: Sat Jul 10 15:41:38 2021 +0300 Added help message. commit eca35e0 Author: astand <ast.and@bk.ru> Date: Sat Jul 10 15:22:25 2021 +0300 Project became executable (CLI). commit 1d168d9 Author: astand <ast.and@bk.ru> Date: Sat Jul 10 15:21:30 2021 +0300 Added option for rewriting source output files. commit 8456d4c Author: astand <ast.and@bk.ru> Date: Sat Jul 10 15:20:45 2021 +0300 Fixed windows related issues. commit 776a05a Author: astand <ast.and@bk.ru> Date: Sat May 15 12:59:49 2021 +0300 Added DBC version info parsing. commit e06f777 Author: astand <ast.and@bk.ru> Date: Sun Apr 4 13:40:01 2021 +0300 Added start info as user defined text. commit 12c735f Author: astand <ast.and@bk.ru> Date: Thu Apr 1 20:13:05 2021 +0300 Fixed value table first pair skipping. commit 1ff121b Author: astand <ast.and@bk.ru> Date: Tue Mar 30 21:38:02 2021 +0300 Fixed GetFrameHash call syntax. commit abfcc41 Author: astand <ast.and@bk.ru> Date: Sat Mar 27 14:17:25 2021 +0300 True fix issue with big comment section. commit b714eb0 Author: astand <ast.and@bk.ru> Date: Sun Mar 14 22:50:22 2021 +0300 Fixed issue with big comment and localization. commit 2ccb121 Author: astand <ast.and@bk.ru> Date: Sat Mar 6 19:10:51 2021 +0300 Fixed macros for *_phys <-> *_ro signal conversion. commit d15afe6 Author: astand <ast.and@bk.ru> Date: Thu Mar 4 13:08:48 2021 +0300 Updated comment text in drv_conf.h file. commit b5a687b Author: astand <ast.and@bk.ru> Date: Thu Mar 4 13:08:31 2021 +0300 Fixed integer x = ***_toS(x) issue. Added postfix *_ro to non simple signals. commit 43730ed Author: astand <ast.and@bk.ru> Date: Thu Mar 4 12:33:20 2021 +0300 Changed comments in gen code. commit 1e837ce Author: astand <ast.and@bk.ru> Date: Thu Mar 4 12:32:55 2021 +0300 Fixed issue when DLC is less then actual Message layout takes. commit b67759b Author: astand <ast.and@bk.ru> Date: Sun Feb 28 16:03:41 2021 +0300 GetSystemTick func name. commit ab5ccec Author: astand <ast.and@bk.ru> Date: Thu Feb 18 22:19:48 2021 +0300 Fixed grammar errors. commit 0cc9b3e Author: astand <ast.and@bk.ru> Date: Wed Feb 17 14:46:17 2021 +0300 Removed cmake dir. commit 60abfec Author: astand <ast.and@bk.ru> Date: Wed Feb 17 14:13:04 2021 +0300 Added template ***-config.h generation. commit cf4ac28 Author: astand <ast.and@bk.ru> Date: Wed Feb 17 11:56:42 2021 +0300 Simple support for multiplexed signals. commit b952fab Author: astand <ast.and@bk.ru> Date: Wed Feb 17 10:48:37 2021 +0300 Fixed issue with comment text for message. commit 051df8e Author: astand <ast.and@bk.ru> Date: Wed Feb 17 10:48:17 2021 +0300 Fixed value table code printing issue. commit c369336 Author: astand <ast.and@bk.ru> Date: Wed Feb 17 10:38:43 2021 +0300 resplit has more param - type of pslit strategy. (was only NOT matched). commit b3af676 Author: astand <ast.and@bk.ru> Date: Sun Feb 14 00:18:39 2021 +0300 Added cmake building. commit 4fd5116 Author: astand <ast.and@bk.ru> Date: Sat Feb 13 23:48:24 2021 +0300 Added util source print. commit c0bc4b1 Author: astand <ast.and@bk.ru> Date: Wed Feb 10 20:01:58 2021 +0300 Fixed minor issues (warnings). commit 147994a Author: astand <ast.and@bk.ru> Date: Wed Feb 10 19:50:20 2021 +0300 Removed unused code. commit 00748b3 Author: astand <ast.and@bk.ru> Date: Wed Feb 10 19:48:11 2021 +0300 Added util header print. Some additional improvements. commit ad787bc Author: astand <ast.and@bk.ru> Date: Wed Feb 10 12:14:09 2021 +0300 Added first variant of util generator. commit bc72a4f Author: astand <ast.and@bk.ru> Date: Wed Feb 10 10:18:36 2021 +0300 Formatter function for printf. commit 9e400db Author: astand <ast.and@bk.ru> Date: Sun Feb 7 17:49:35 2021 +0300 On ubuntu getline puts (or shows) '\r' at the end of line. commit 9cd3049 Author: astand <ast.and@bk.ru> Date: Sun Feb 7 17:48:36 2021 +0300 Fixed some issues. commit 79fc48e Author: astand <ast.and@bk.ru> Date: Sun Feb 7 16:41:05 2021 +0300 Fixed comment printing. commit 0947ebf Author: astand <ast.and@bk.ru> Date: Sat Feb 6 14:50:38 2021 +0300 Added CSM calc and pack in both Pack functions. commit 6798987 Author: astand <ast.and@bk.ru> Date: Wed Feb 3 18:53:47 2021 +0300 Added CSM check in unpack function. commit e56d43c Author: astand <ast.and@bk.ru> Date: Wed Feb 3 18:41:18 2021 +0300 Added Checksum signal detection. commit a7d6cf0 Author: astand <ast.and@bk.ru> Date: Wed Feb 3 17:01:54 2021 +0300 Common refactoring and bug fix (field width). commit d7fdcaf Author: astand <ast.and@bk.ru> Date: Wed Feb 3 16:59:49 2021 +0300 Added auto rolling handling code. commit 362a4d1 Author: astand <ast.and@bk.ru> Date: Wed Feb 3 16:57:30 2021 +0300 Removed empty phys macro in pack functions. commit 69e9687 Author: astand <ast.and@bk.ru> Date: Sun Jan 31 23:47:51 2021 +0300 Added changed for Linux building. commit a719f72 Author: astand <quater873@gmail.com> Date: Sun Jan 31 18:58:44 2021 +0300 Added fmon-source file generation. commit e634227 Author: astand <quater873@gmail.com> Date: Sun Jan 31 18:37:08 2021 +0300 Added fmon-header file generation. commit 25ba556 Author: astand <quater873@gmail.com> Date: Sun Jan 31 17:46:19 2021 +0300 Source files filling moved to dedicated functions. commit d6b8c46 Author: astand <quater873@gmail.com> Date: Sun Jan 31 17:35:25 2021 +0300 Small refactoring. commit ba88964 Author: astand <quater873@gmail.com> Date: Mon Jan 25 20:55:01 2021 +0300 Fixed comment style. CYC value bug. commit 950ed79 Author: astand <quater873@gmail.com> Date: Mon Jan 25 20:53:37 2021 +0300 Fixed warning on unused param (dlc) in Unpack function. commit bd87a48 Author: astand <quater873@gmail.com> Date: Mon Jan 25 13:17:53 2021 +0300 Fixed generator formatting bugs. commit 22ea2f1 Author: astand <quater873@gmail.com> Date: Mon Jan 25 13:17:35 2021 +0300 Fixed bug in sign of sigfloat type signal. commit 2cd8af4 Author: astand <quater873@gmail.com> Date: Mon Jan 25 11:32:02 2021 +0300 Added "*_phys" sigs and auto toS/fromS conversion. commit e95d50a Author: astand <quater873@gmail.com> Date: Mon Jan 25 11:31:15 2021 +0300 Fixed "fromS" macro - type cast must be skipped. commit d4e1603 Author: astand <quater873@gmail.com> Date: Mon Jan 25 11:30:17 2021 +0300 Added more signal type class (3 classes for now). commit 11426cc Author: astand <ast.and@bk.ru> Date: Thu Jan 21 21:53:17 2021 +0300 Added print toS and fromS macros. commit 3d57bbe Author: astand <ast.and@bk.ru> Date: Thu Jan 21 21:51:59 2021 +0300 Do not make signal conversation inside unpack function. commit b8ad3cb Author: astand <ast.and@bk.ru> Date: Thu Jan 21 21:51:24 2021 +0300 Helpers added. commit 4c18e40 Author: astand <ast.and@bk.ru> Date: Thu Jan 21 21:50:36 2021 +0300 Fixed minor issues. commit bdd4061 Author: astand <ast.and@bk.ru> Date: Thu Jan 21 17:26:33 2021 +0300 Signal type detection refactored. commit 981b25a Author: astand <ast.and@bk.ru> Date: Thu Jan 21 11:49:30 2021 +0300 Added 2-Pack functions bodies. commit 1557550 Author: astand <ast.and@bk.ru> Date: Mon Jan 11 20:37:43 2021 +0300 Basic struct and unpack func in -c main source code. commit bf0ed04 Author: astand <ast.and@bk.ru> Date: Mon Jan 11 20:10:42 2021 +0300 Fs creator keeps lowcase drvname in separated field. commit 246a2b9 Author: astand <ast.and@bk.ru> Date: Mon Jan 11 20:09:16 2021 +0300 Style format. commit 30edc79 Author: astand <ast.and@bk.ru> Date: Mon Jan 11 20:08:53 2021 +0300 Renamed variable for clarificatin. commit c7ae93e Author: astand <ast.and@bk.ru> Date: Mon Jan 11 20:08:30 2021 +0300 Fixed unpack sig format bug. commit ff267a4 Author: astand <quater873@gmail.com> Date: Mon Jan 11 16:58:20 2021 +0300 PrintF refactored completely. commit b0856e0 Author: astand <quater873@gmail.com> Date: Mon Jan 11 16:46:14 2021 +0300 Using fsd filelds for #ifdef selection. commit fc9663a Author: astand <ast.and@bk.ru> Date: Sun Dec 13 01:08:31 2020 +0300 Added separated common attributes creator. commit 74b4b2d Author: astand <ast.and@bk.ru> Date: Sat Dec 12 00:40:04 2020 +0300 Added printF optimization. commit 98c8eda Author: astand <ast.and@bk.ru> Date: Sat Dec 12 00:30:42 2020 +0300 Added Functions prototypes printing. commit c620841 Author: astand <ast.and@bk.ru> Date: Fri Dec 11 23:54:15 2020 +0300 Added mon1 field if defined setting. commit 2a2ff62 Author: astand <ast.and@bk.ru> Date: Mon Dec 7 12:58:05 2020 +0300 Added c++17 in project option. commit 14f7017 Author: astand <ast.and@bk.ru> Date: Mon Dec 7 12:57:33 2020 +0300 Added part of main .h file writer. Added filewriter. commit 7b13500 Author: astand <ast.and@bk.ru> Date: Thu Nov 26 22:17:48 2020 +0300 Added minimal struct of main code generator. commit 26cf3f3 Author: astand <ast.and@bk.ru> Date: Thu Nov 26 22:12:57 2020 +0300 SigPrinter minor refactoring. Income Msgs as const. commit 44e2db2 Author: astand <ast.and@bk.ru> Date: Thu Nov 26 14:45:56 2020 +0300 Added offset calculation in to_signal expression. commit 4915ed1 Author: astand <ast.and@bk.ru> Date: Thu Nov 26 11:58:18 2020 +0300 Added core signals/message expression printer code. commit 45a85ac Author: astand <ast.and@bk.ru> Date: Thu Nov 26 10:12:28 2020 +0300 Added sig-expression and sig-printer base code. commit 6350af4 Author: astand <ast.and@bk.ru> Date: Thu Nov 26 10:11:47 2020 +0300 Code dir migration. commit ab769a9 Author: astand <ast.and@bk.ru> Date: Sun Nov 22 22:30:17 2020 +0300 Added value table parsing. commit 7bd24c5 Author: astand <ast.and@bk.ru> Date: Sat Nov 21 22:44:01 2020 +0300 Added basic dbcscanner core code.
1 parent bc79cf9 commit abf6977

File tree

4 files changed

+45
-29
lines changed

4 files changed

+45
-29
lines changed

docs/RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v2.9
4+
5+
- prt_double refactored
6+
37
## v2.8
48

59
### Fixed

src/codegen/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
#include <stdint.h>
44

55
#define CODEGEN_LIB_VERSION_MAJ (2)
6-
#define CODEGEN_LIB_VERSION_MIN (8)
6+
#define CODEGEN_LIB_VERSION_MIN (9)

src/helpers/formatter.cpp

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
#include "formatter.h"
2-
#include <limits>
31
#include <algorithm>
2+
#include <limits>
43
#include <iomanip>
54
#include <sstream>
5+
#include "formatter.h"
66

77
static const size_t kMaxWorkArrLength = 4096;
88

@@ -149,18 +149,17 @@ std::string make_c_name(const std::string& s)
149149

150150
std::string prt_double(double value, size_t precision, bool usedot)
151151
{
152-
precision = std::min(precision, (size_t)std::numeric_limits<double>::digits10);
153-
154-
std::stringstream ss;
155-
ss.imbue(std::locale::classic());
156-
ss << std::fixed << std::setprecision(precision) << value;
152+
std::stringstream strstrm;
153+
strstrm.imbue(std::locale::classic());
154+
strstrm << std::fixed << std::setprecision(10) << value;
157155

158-
std::string s(ss.str());
156+
std::string s(strstrm.str());
159157

160-
size_t i = s.find('.');
158+
size_t dotpos = s.find('.');
161159

162-
if (i == std::string::npos)
160+
if (dotpos == std::string::npos)
163161
{
162+
// dot not found
164163
if (usedot)
165164
{
166165
s += ".0";
@@ -170,27 +169,33 @@ std::string prt_double(double value, size_t precision, bool usedot)
170169
}
171170

172171
// remove trailing zeros after decimal delimiter (dot char)
173-
size_t j;
172+
size_t tailsize = std::min((s.size() - (dotpos + 1u)), precision);
173+
size_t addtail = 0u;
174174

175-
for (j = s.size() - 1; (j > i) && (s[j] == '0'); --j)
175+
for (size_t j = 0; j < tailsize; j++)
176176
{
177+
auto ch = s[dotpos + 1u + j];
178+
179+
if (ch > '0' && ch <= '9')
180+
{
181+
addtail = j + 1;
182+
}
177183
}
178184

179-
if (j == i)
185+
if (addtail == 0)
180186
{
187+
// precision == 0 or xxx.0(0) resize cut tail with dot
188+
s.resize(dotpos);
189+
181190
if (usedot)
182191
{
183-
s.resize(j + 1);
184-
s += '0';
185-
}
186-
else
187-
{
188-
s.resize(j);
192+
s += ".0";
189193
}
190194
}
191195
else
192196
{
193-
s.resize(j + 1);
197+
// xxx.x(x)
198+
s.resize(dotpos + addtail + 1);
194199
}
195200

196201
return s;

src/tests/dbcline-test.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,22 @@ TEST(TestSigLineParsing, test_prt_double)
133133

134134
constexpr double v4 = 20.4699999999;
135135

136-
expect_eq(prt_double(v4, 9), "20.47");
137-
expect_eq(prt_double(v4, 8), "20.47");
138-
expect_eq(prt_double(v4, 7), "20.47");
139-
expect_eq(prt_double(v4, 3), "20.47");
136+
expect_eq(prt_double(v4, 9), "20.469999999");
137+
expect_eq(prt_double(v4, 8), "20.46999999");
138+
expect_eq(prt_double(v4, 7), "20.4699999");
139+
expect_eq(prt_double(v4, 3), "20.469");
140140

141141
constexpr double v5 = -20.4699999999;
142142

143-
expect_eq(prt_double(v5, 8), "-20.47");
144-
expect_eq(prt_double(v5, 7), "-20.47");
145-
expect_eq(prt_double(v5, 3), "-20.47");
146-
expect_eq(prt_double(v5, 9), "-20.47");
143+
expect_eq(prt_double(v5, 8), "-20.46999999");
144+
expect_eq(prt_double(v5, 7), "-20.4699999");
145+
expect_eq(prt_double(v5, 3), "-20.469");
146+
expect_eq(prt_double(v5, 10), "-20.4699999999");
147+
expect_eq(prt_double(v5, 11), "-20.4699999999");
148+
expect_eq(prt_double(v5, 15), "-20.4699999999");
149+
150+
constexpr double v6 = 123.012345678900000;
151+
expect_eq(prt_double(v6, 10), "123.0123456789");
152+
expect_eq(prt_double(v6, 11), "123.0123456789");
153+
expect_eq(prt_double(v6, 15), "123.0123456789");
147154
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy