diff --git a/docker/Dockerfile.centos8-cpp-env b/docker/Dockerfile.centos8-cpp-env new file mode 100644 index 000000000..0bcda9d56 --- /dev/null +++ b/docker/Dockerfile.centos8-cpp-env @@ -0,0 +1,27 @@ +# CLion remote docker environment (How to build docker container, run and stop it) +# +# Build: +# docker build -t build/centos-8/cpp-env:1.0 -f Dockerfile.centos8-cpp-env . + +FROM centos:8 + +RUN yum -y update && yum -y install dnf-plugins-core && yum config-manager --set-enabled powertools && yum -y install \ + openssh-server \ + make \ + autoconf \ + automake \ + dos2unix \ + gcc \ + gcc-c++ \ + gdb \ + clang \ + cmake \ + rsync \ + tar \ + python39 \ + doxygen \ + graphviz \ + swig \ + ninja-build \ + wget \ + && yum clean all diff --git a/docker/Dockerfile.ubuntu20-cpp-env b/docker/Dockerfile.ubuntu20-cpp-env new file mode 100644 index 000000000..79a33f774 --- /dev/null +++ b/docker/Dockerfile.ubuntu20-cpp-env @@ -0,0 +1,28 @@ +# Build and run: +# docker build -t build/ubuntu-20.04/cpp-env:1.0 -f Dockerfile.ubuntu20-cpp-env . + +FROM ubuntu:20.04 + +RUN DEBIAN_FRONTEND="noninteractive" apt-get update && apt-get -y install tzdata +RUN apt-get update && apt-get -y install \ + build-essential \ + gcc \ + g++ \ + gdb \ + clang \ + make \ + ninja-build \ + cmake \ + autoconf \ + automake \ + locales-all \ + dos2unix \ + rsync \ + tar \ + python \ + python-dev \ + doxygen \ + graphviz \ + swig \ + wget \ + && apt-get clean diff --git a/src/omega_edit/src/encodings.c b/src/omega_edit/src/encodings.c index 0eecfd23f..1093192e3 100644 --- a/src/omega_edit/src/encodings.c +++ b/src/omega_edit/src/encodings.c @@ -19,9 +19,9 @@ size_t omega_bin2hex(const omega_byte_t *src, char *dst, size_t src_length) { assert(src); assert(dst); static const char HEX_CONVERSION_TABLE[] = "0123456789abcdef"; - size_t j = 0; + size_t i, j = 0; - for (size_t i = 0; i < src_length; ++i) { + for (i = 0; i < src_length; ++i) { dst[j++] = HEX_CONVERSION_TABLE[src[i] >> 4]; dst[j++] = HEX_CONVERSION_TABLE[src[i] & 15]; } diff --git a/src/omega_edit/src/impl_/session_def.hpp b/src/omega_edit/src/impl_/session_def.hpp index 69a8f583e..0e769a283 100644 --- a/src/omega_edit/src/impl_/session_def.hpp +++ b/src/omega_edit/src/impl_/session_def.hpp @@ -18,6 +18,7 @@ #include "../../include/edit.h" #include "../../include/fwd_defs.h" #include "internal_fwd_defs.hpp" +#include "model_def.hpp" #include #include #include diff --git a/src/omega_edit/src/utility.c b/src/omega_edit/src/utility.c index df63135c6..f3c6ab04d 100644 --- a/src/omega_edit/src/utility.c +++ b/src/omega_edit/src/utility.c @@ -40,7 +40,8 @@ int omega_util_file_exists(const char *file_name) { void omega_util_byte_transformer(omega_byte_t *buffer, int64_t len, omega_util_byte_transform_t transform) { assert(buffer); - for (int64_t i = 0; i < len; ++i) { buffer[i] = transform(buffer[i]); } + int64_t i; + for (i = 0; i < len; ++i) { buffer[i] = transform(buffer[i]); } } int omega_util_left_shift_buffer(omega_byte_t *buffer, int64_t len, omega_byte_t shift_left) { @@ -49,7 +50,8 @@ int omega_util_left_shift_buffer(omega_byte_t *buffer, int64_t len, omega_byte_t omega_byte_t shift_right = 8 - shift_left; omega_byte_t mask = ((1 << shift_left) - 1) << shift_right; omega_byte_t bits1 = 0; - for (int64_t i = len - 1; i >= 0; --i) { + int64_t i; + for (i = len - 1; i >= 0; --i) { const unsigned char bits2 = buffer[i] & mask; buffer[i] <<= shift_left; buffer[i] |= bits1 >> shift_right; @@ -66,7 +68,8 @@ int omega_util_right_shift_buffer(omega_byte_t *buffer, int64_t len, omega_byte_ omega_byte_t shift_left = 8 - shift_right; omega_byte_t mask = (1 << shift_right) - 1; omega_byte_t bits1 = 0; - for (int64_t i = len - 1; i >= 0; --i) { + int64_t i; + for (i = len - 1; i >= 0; --i) { const unsigned char bits2 = buffer[i] & mask; buffer[i] >>= shift_right; buffer[i] |= bits1 << shift_left;