This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rectangle | |
{ | |
width: parent.width | |
height: parent.height | |
border.color: "red" | |
border.width: 1 | |
color: "transparent" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (CMAKE_BUILD_TYPE MATCHES "^[Rr]elease") | |
# do stuff | |
endif() | |
if (CMAKE_BUILD_TYPE MATCHES "^[Dd]ebug") | |
# do stuff | |
endif() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QString DumpByteArray(QByteArray& rawData) | |
{ | |
QString res = "{ "; | |
for (int i = 0; i<rawData.size(); ++i) | |
{ | |
res += "0x"; | |
res += QString::number((rawData[i] >> 4) & 0xF, 16); | |
res += QString::number((rawData[i]) & 0xF, 16); | |
if (i != rawData.size() - 1) | |
res += ", "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://gist.github.com/albertz/1551304 | |
#include <stdio.h> | |
#include <assert.h> | |
int main(int argc, char** argv) { | |
assert(argc == 2); | |
char* fn = argv[1]; | |
FILE* f = fopen(fn, "r"); | |
printf("char a[] = {\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET(EREIFLASH_VERSION_MAJOR 1) | |
SET(EREIFLASH_VERSION_MINOR 0) | |
SET(EREIFLASH_VERSION_PATCH 0) | |
IF( EXISTS "${CMAKE_SOURCE_DIR}/.git" ) | |
EXECUTE_PROCESS( | |
COMMAND git describe --tags --always | |
WORKING_DIRECTORY ${EREIFLASH_SOURCE_DIR} | |
OUTPUT_VARIABLE EREIFLASH_VERSION_TAG | |
OUTPUT_STRIP_TRAILING_WHITESPACE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef __GNUC__ | |
/*code for GNU C compiler */ | |
#define PRE_PACKED_ENUM_DEF | |
#define POST_PACKED_ENUM_DEF __attribute__((packed)); | |
#elif _MSC_VER | |
/*code specific to MSVC compiler*/ | |
#define PRE_PACKED_ENUM_DEF __pragma(pack(push, 1)) | |
#define POST_PACKED_ENUM_DEF __pragma(pack(pop)); | |
#elif __MINGW32__ | |
/*code specific to mingw compilers*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef WIN32 | |
#ifdef LIB_SHARED // Shared build | |
#define LIB_API __declspec(dllexport) | |
#elif LIB_STATIC // No decoration when building staticlly | |
#define LIB_API | |
#else // Link to lib | |
#define LIB_API __declspec(dllimport) | |
#endif | |
#else | |
#define LIB_API |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ANSI_FG_RED "\x1b[31m" | |
#define ANSI_FG_BRIGHT_RED "\x1b[91m" | |
#define ANSI_FG_GREEN "\x1b[32m" | |
#define ANSI_FG_BRIGHT_GREEN "\x1b[92m" | |
#define ANSI_FG_YELLOW "\x1b[33m" | |
#define ANSI_FG_BRIGHT_YELLOW "\x1b[93m" | |
#define ANSI_FG_BLUE "\x1b[34m" | |
#define ANSI_FG_BRIGHT_BLUE "\x1b[94m" | |
#define ANSI_FG_MAGENTA "\x1b[35m" | |
#define ANSI_FG_BRIGHT_MAGENTA "\x1b[95m" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size_t getline(char **lineptr, size_t *n, FILE *stream) { | |
char *bufptr = nullptr; | |
size_t it = 0; | |
int c; | |
if (lineptr == nullptr) { | |
return -1; | |
} | |
if (stream == nullptr) { | |
return -1; |
NewerOlder