move typedefs to a header file
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sat, 23 Dec 2017 20:13:24 +0100
changeset 1917785b69430d
parent 18 4975c24cc361
child 20 b9ceffdcaf14
move typedefs to a header file
c++/rgb-assembler/nbproject/configurations.xml
c++/rgb-assembler/nbproject/project.xml
c++/rgb-assembler/rgb-assembler.cpp
c++/rgb-assembler/types.h
     1.1 --- a/c++/rgb-assembler/nbproject/configurations.xml	Sat Dec 23 17:52:32 2017 +0100
     1.2 +++ b/c++/rgb-assembler/nbproject/configurations.xml	Sat Dec 23 20:13:24 2017 +0100
     1.3 @@ -4,6 +4,7 @@
     1.4      <logicalFolder name="HeaderFiles"
     1.5                     displayName="Header Files"
     1.6                     projectFiles="true">
     1.7 +      <itemPath>types.h</itemPath>
     1.8      </logicalFolder>
     1.9      <logicalFolder name="ResourceFiles"
    1.10                     displayName="Resource Files"
    1.11 @@ -42,6 +43,8 @@
    1.12        </compileType>
    1.13        <item path="rgb-assembler.cpp" ex="false" tool="1" flavor2="0">
    1.14        </item>
    1.15 +      <item path="types.h" ex="false" tool="3" flavor2="0">
    1.16 +      </item>
    1.17      </conf>
    1.18      <conf name="Release" type="1">
    1.19        <toolsSet>
    1.20 @@ -66,6 +69,8 @@
    1.21        </compileType>
    1.22        <item path="rgb-assembler.cpp" ex="false" tool="1" flavor2="0">
    1.23        </item>
    1.24 +      <item path="types.h" ex="false" tool="3" flavor2="0">
    1.25 +      </item>
    1.26      </conf>
    1.27    </confs>
    1.28  </configurationDescriptor>
     2.1 --- a/c++/rgb-assembler/nbproject/project.xml	Sat Dec 23 17:52:32 2017 +0100
     2.2 +++ b/c++/rgb-assembler/nbproject/project.xml	Sat Dec 23 20:13:24 2017 +0100
     2.3 @@ -6,7 +6,7 @@
     2.4              <name>rgb-assembler</name>
     2.5              <c-extensions/>
     2.6              <cpp-extensions>cpp</cpp-extensions>
     2.7 -            <header-extensions/>
     2.8 +            <header-extensions>h</header-extensions>
     2.9              <sourceEncoding>UTF-8</sourceEncoding>
    2.10              <make-dep-projects/>
    2.11              <sourceRootList/>
     3.1 --- a/c++/rgb-assembler/rgb-assembler.cpp	Sat Dec 23 17:52:32 2017 +0100
     3.2 +++ b/c++/rgb-assembler/rgb-assembler.cpp	Sat Dec 23 20:13:24 2017 +0100
     3.3 @@ -7,15 +7,10 @@
     3.4  #include <chrono>
     3.5  #include <thread>
     3.6  
     3.7 +#include "types.h"
     3.8 +
     3.9  using namespace std;
    3.10  
    3.11 -typedef uint16_t address_t;
    3.12 -typedef uint8_t octet_t;
    3.13 -typedef uint8_t command_t;
    3.14 -typedef uint8_t sleep_t;
    3.15 -typedef uint8_t color_t;
    3.16 -typedef uint8_t led_t;
    3.17 -
    3.18  // TODO: strong typedefs http://www.boost.org/doc/libs/1_61_0/libs/serialization/doc/strong_typedef.html ?
    3.19  
    3.20  const address_t MEMORY_SIZE = 1024;
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/c++/rgb-assembler/types.h	Sat Dec 23 20:13:24 2017 +0100
     4.3 @@ -0,0 +1,10 @@
     4.4 +#pragma once
     4.5 +
     4.6 +#include <cstdint>
     4.7 +
     4.8 +typedef uint16_t address_t;
     4.9 +typedef uint8_t octet_t;
    4.10 +typedef uint8_t command_t;
    4.11 +typedef uint8_t sleep_t;
    4.12 +typedef uint8_t color_t;
    4.13 +typedef uint8_t led_t;