From d88b89ba8915a8b52de036ad67697289e644960b Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 16:57:00 +0200 Subject: [PATCH 01/15] Clarified calculation precedence for '&' and '?' --- src/utf8.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utf8.cc b/src/utf8.cc index b509ef3..129f36e 100644 --- a/src/utf8.cc +++ b/src/utf8.cc @@ -45,7 +45,7 @@ void write_utf8(FILE* t_out, uint32_t t_c) { ustring str(loops + 1, 0); for (size_t i = 0; i <= loops; ++i) { str[i] = static_cast( - ((t_c & (i == loops) ? 0x3F : 0xFF) >> ((loops - i) * 6)) + + ((t_c & ((i == loops) ? 0x3F : 0xFF)) >> ((loops - i) * 6)) + ((i == 0) ? header : 0x80)); } fwrite(str.data(), sizeof(unsigned char), str.size(), t_out); From 8c93b6428fa0249dec907388bcf46a4965c0cae6 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 17:28:05 +0200 Subject: [PATCH 02/15] Create README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..1226b7c --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +[![Travis Badge](https://travis-ci.org/Phundrak/lzw-assignment.svg?branch=master)](https://travis-ci.org/Phundrak/lzw-assignment.svg?branch=master]) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/e8fd3d18f7c54055ac30dca378d2ada8)](https://www.codacy.com/app/Phundrak/PhundrakSTL?utm_source=github.com&utm_medium=referral&utm_content=Phundrak/PhundrakSTL&utm_campaign=Badge_Grade) +[![Spacemacs Badge](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org) + +# LZW Compressing tool + +This is a university assignment for which I aim to create an LZW algorithm implementation to create a small tool similar to `gzip` and `gunzip` that can compress and uncompress files in a lossless fashion. + +This project is written is C++17, compiled with clang under a UNIX environment. Other compilers and environments will not be tested. From 9479246f4b93ddd36e18d65d0ca8c31f52d52177 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 17:28:22 +0200 Subject: [PATCH 03/15] Delete README.org --- README.org | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 README.org diff --git a/README.org b/README.org deleted file mode 100644 index aceecf0..0000000 --- a/README.org +++ /dev/null @@ -1,7 +0,0 @@ -[[https://travis-ci.org/Phundrak/lzw-assignment][https://travis-ci.org/Phundrak/lzw-assignment.svg?branch=master]] [[http://spacemacs.org][file:https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg]] - -* LZW Compressing tool - -This is a university assignment for which I aim to create an LZW algorithm implementation to create a small tool similar to =gzip= and =gunzip= that can compress and uncompress files in a lossless fashion. - -This project is written is C++17, compiled with clang under a UNIX environment. Other compilers and environments will not be tested. From 792f2e5dbcb5a088fc1f6db4e7b89a4730f0f8ab Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 17:33:20 +0200 Subject: [PATCH 04/15] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1226b7c..babda96 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Travis Badge](https://travis-ci.org/Phundrak/lzw-assignment.svg?branch=master)](https://travis-ci.org/Phundrak/lzw-assignment.svg?branch=master]) +[![Travis Badge](https://travis-ci.org/Phundrak/lzw-assignment.svg?branch=master)](https://travis-ci.org/Phundrak/lzw-assignment) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/e8fd3d18f7c54055ac30dca378d2ada8)](https://www.codacy.com/app/Phundrak/PhundrakSTL?utm_source=github.com&utm_medium=referral&utm_content=Phundrak/PhundrakSTL&utm_campaign=Badge_Grade) [![Spacemacs Badge](https://cdn.rawgit.com/syl20bnr/spacemacs/442d025779da2f62fc86c2082703697714db6514/assets/spacemacs-badge.svg)](http://spacemacs.org) From 9200af91260dee21d97c4d0c8bd404b7ebb92618 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:27:26 +0200 Subject: [PATCH 05/15] Test appveyor --- appveyor.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..5eb2089 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,21 @@ +version: '{branch}-{build}' + +environment: + matrix: + - configuration: + - Debug + - configuration: + - Release + +APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 +MSVC_GENERATOR: Visual Studio 15 2017 +MSVC_GENERATOR_SHORT: VS2017 + +platform: + - x64 + +shallow_clone: true + +build_script: + - cmd: cd build + - cmd: cmake -DCMAKE_BUILD_TYPE=%configuration% .. From cf7cf67c229c8a45bea5ddb654d4c1f6109a19c4 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:27:56 +0200 Subject: [PATCH 06/15] Update appveyor.yml --- appveyor.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 5eb2089..37c6f02 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,10 +2,8 @@ version: '{branch}-{build}' environment: matrix: - - configuration: - - Debug - - configuration: - - Release + - configuration: Debug + - configuration: Release APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 MSVC_GENERATOR: Visual Studio 15 2017 From 4ad47489b8d80bdbe4ad1c2596d531437d5cbddb Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:28:48 +0200 Subject: [PATCH 07/15] Update appveyor.yml --- appveyor.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 37c6f02..bb2f24d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,12 +2,15 @@ version: '{branch}-{build}' environment: matrix: - - configuration: Debug - - configuration: Release + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + MSVC_GENERATOR: Visual Studio 14 2015 + MSVC_GENERATOR_SHORT: VS2015 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + MSVC_GENERATOR: Visual Studio 15 2017 + MSVC_GENERATOR_SHORT: VS2017 -APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 -MSVC_GENERATOR: Visual Studio 15 2017 -MSVC_GENERATOR_SHORT: VS2017 +configuration: + - Debug platform: - x64 From 52ba0de9ec7da1c44795fd92b374bd3c0b096ab2 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:30:33 +0200 Subject: [PATCH 08/15] Update appveyor.yml --- appveyor.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bb2f24d..0af1d35 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -2,9 +2,6 @@ version: '{branch}-{build}' environment: matrix: - - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 - MSVC_GENERATOR: Visual Studio 14 2015 - MSVC_GENERATOR_SHORT: VS2015 - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 MSVC_GENERATOR: Visual Studio 15 2017 MSVC_GENERATOR_SHORT: VS2017 @@ -20,3 +17,4 @@ shallow_clone: true build_script: - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=%configuration% .. + - cmd: make From d43f2b9dc3cad57894f954c700abaa20b4022a31 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:37:27 +0200 Subject: [PATCH 09/15] Update appveyor.yml --- appveyor.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 0af1d35..05eb693 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,9 +5,6 @@ environment: - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 MSVC_GENERATOR: Visual Studio 15 2017 MSVC_GENERATOR_SHORT: VS2017 - -configuration: - - Debug platform: - x64 @@ -16,5 +13,5 @@ shallow_clone: true build_script: - cmd: cd build - - cmd: cmake -DCMAKE_BUILD_TYPE=%configuration% .. - - cmd: make + - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. + - cmd: cmake --build From d1f5c47f66f45cf6019a8fba55e38050610beb56 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:41:32 +0200 Subject: [PATCH 10/15] Update appveyor.yml --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 05eb693..64cfb66 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,9 @@ platform: shallow_clone: true +before_build: + - cmd: choco install make + build_script: - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. From 34808142121e2499fa450624b0095b1ffeab84aa Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:42:35 +0200 Subject: [PATCH 11/15] Update appveyor.yml --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 64cfb66..7c94669 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,4 +17,4 @@ before_build: build_script: - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. - - cmd: cmake --build + - cmd: make From 0bf36f6523cd470f8c08c7c760b7fb4b9c19cae5 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:45:46 +0200 Subject: [PATCH 12/15] Update appveyor.yml --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 7c94669..88b0de0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,12 +9,15 @@ environment: platform: - x64 +MAKE_DIR=C:/projects/lzw-assignment/build + shallow_clone: true before_build: - cmd: choco install make build_script: + - cmd: set Path=%MAKE_DIR%;%Path% - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. - cmd: make From cb5a1e4ce772bf72a30eb92ff883af9729c28b66 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:47:22 +0200 Subject: [PATCH 13/15] Update appveyor.yml --- appveyor.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 88b0de0..c59697b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -9,15 +9,12 @@ environment: platform: - x64 -MAKE_DIR=C:/projects/lzw-assignment/build - shallow_clone: true before_build: - cmd: choco install make build_script: - - cmd: set Path=%MAKE_DIR%;%Path% - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. - - cmd: make + - cmd: C:\ProgramData\chocolatey\lib\make\tools\make.exe From 9d9fee19410dd94ed664389cae0fec48a8ee59c0 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:50:35 +0200 Subject: [PATCH 14/15] Update appveyor.yml --- appveyor.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index c59697b..d9f53e6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,6 +15,7 @@ before_build: - cmd: choco install make build_script: + - cmd: set PATH=%PATH%;C:\ProgramData\chocolatey\lib\make\tools - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. - - cmd: C:\ProgramData\chocolatey\lib\make\tools\make.exe + - cmd: make From 2b3c1cd8eafc4258cc276fd9d40a519b8f0312e4 Mon Sep 17 00:00:00 2001 From: Phuntsok Drak-pa Date: Sun, 15 Apr 2018 18:52:04 +0200 Subject: [PATCH 15/15] Update appveyor.yml --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index d9f53e6..1c3a1fc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,4 +18,5 @@ build_script: - cmd: set PATH=%PATH%;C:\ProgramData\chocolatey\lib\make\tools - cmd: cd build - cmd: cmake -DCMAKE_BUILD_TYPE=Debug .. + - cmd: dir - cmd: make