diff --git a/README.md b/README.md new file mode 100644 index 0000000..babda96 --- /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) +[![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. 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. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..1c3a1fc --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,22 @@ +version: '{branch}-{build}' + +environment: + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + MSVC_GENERATOR: Visual Studio 15 2017 + MSVC_GENERATOR_SHORT: VS2017 + +platform: + - x64 + +shallow_clone: true + +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: dir + - cmd: make 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);