Ticket #2996: 0006-Make-gcc-happy.patch

File 0006-Make-gcc-happy.patch, 11.6 KB (added by BogDan, 9 years ago)
  • source/lib/debug.cpp

    From 0ad3359ed2eb3f1bcc3d9a19ef5b6e3bcf1e3521 Mon Sep 17 00:00:00 2001
    From: BogDan Vatra <bogdan@kde.org>
    Date: Tue, 27 Jan 2015 14:27:28 +0200
    Subject: [PATCH 6/6] Make gcc happy.
    
    ---
     source/lib/debug.cpp                | 20 +++++-----
     source/lib/file/archive/archive.cpp |  4 +-
     source/lib/file/vfs/vfs.cpp         |  6 +--
     source/lib/path.cpp                 |  8 ++--
     source/lib/res/h_mgr.cpp            | 10 ++---
     source/lib/secure_crt.inl           |  2 +-
     source/lib/status.cpp               | 76 ++++++++++++++++++-------------------
     source/lib/tex/tex.cpp              | 16 ++++----
     source/lib/utf8.cpp                 |  8 ++--
     9 files changed, 75 insertions(+), 75 deletions(-)
    
    diff --git a/source/lib/debug.cpp b/source/lib/debug.cpp
    index 35102c3..d95a55e 100644
    a b  
    4343#endif
    4444
    4545static const StatusDefinition debugStatusDefinitions[] = {
    46     { ERR::SYM_NO_STACK_FRAMES_FOUND, L"No stack frames found" },
    47     { ERR::SYM_UNRETRIEVABLE_STATIC, L"Value unretrievable (stored in external module)" },
    48     { ERR::SYM_UNRETRIEVABLE, L"Value unretrievable" },
    49     { ERR::SYM_TYPE_INFO_UNAVAILABLE, L"Error getting type_info" },
    50     { ERR::SYM_INTERNAL_ERROR, L"Exception raised while processing a symbol" },
    51     { ERR::SYM_UNSUPPORTED, L"Symbol type not (fully) supported" },
    52     { ERR::SYM_CHILD_NOT_FOUND, L"Symbol does not have the given child" },
    53     { ERR::SYM_NESTING_LIMIT, L"Symbol nesting too deep or infinite recursion" },
    54     { ERR::SYM_SINGLE_SYMBOL_LIMIT, L"Symbol has produced too much output" },
    55     { INFO::SYM_SUPPRESS_OUTPUT, L"Symbol was suppressed" }
     46    { ERR::SYM_NO_STACK_FRAMES_FOUND, L"No stack frames found", 0 },
     47    { ERR::SYM_UNRETRIEVABLE_STATIC, L"Value unretrievable (stored in external module)", 0 },
     48    { ERR::SYM_UNRETRIEVABLE, L"Value unretrievable", 0 },
     49    { ERR::SYM_TYPE_INFO_UNAVAILABLE, L"Error getting type_info", 0 },
     50    { ERR::SYM_INTERNAL_ERROR, L"Exception raised while processing a symbol", 0 },
     51    { ERR::SYM_UNSUPPORTED, L"Symbol type not (fully) supported", 0 },
     52    { ERR::SYM_CHILD_NOT_FOUND, L"Symbol does not have the given child", 0 },
     53    { ERR::SYM_NESTING_LIMIT, L"Symbol nesting too deep or infinite recursion", 0 },
     54    { ERR::SYM_SINGLE_SYMBOL_LIMIT, L"Symbol has produced too much output", 0 },
     55    { INFO::SYM_SUPPRESS_OUTPUT, L"Symbol was suppressed", 0 }
    5656};
    5757STATUS_ADD_DEFINITIONS(debugStatusDefinitions);
    5858
  • source/lib/file/archive/archive.cpp

    diff --git a/source/lib/file/archive/archive.cpp b/source/lib/file/archive/archive.cpp
    index fc14027..f3e47a0 100644
    a b  
    2828#include "lib/file/archive/archive.h"
    2929
    3030static const StatusDefinition archiveStatusDefinitions[] = {
    31     { ERR::ARCHIVE_UNKNOWN_FORMAT, L"Unknown archive format" },
    32     { ERR::ARCHIVE_UNKNOWN_METHOD, L"Unknown compression method" }
     31    { ERR::ARCHIVE_UNKNOWN_FORMAT, L"Unknown archive format", 0 },
     32    { ERR::ARCHIVE_UNKNOWN_METHOD, L"Unknown compression method", 0 }
    3333};
    3434STATUS_ADD_DEFINITIONS(archiveStatusDefinitions);
    3535
  • source/lib/file/vfs/vfs.cpp

    diff --git a/source/lib/file/vfs/vfs.cpp b/source/lib/file/vfs/vfs.cpp
    index 09be9e7..3c492a5 100644
    a b  
    3636#include "lib/file/vfs/file_cache.h"
    3737
    3838static const StatusDefinition vfsStatusDefinitions[] = {
    39     { ERR::VFS_DIR_NOT_FOUND, L"VFS directory not found" },
    40     { ERR::VFS_FILE_NOT_FOUND, L"VFS file not found" },
    41     { ERR::VFS_ALREADY_MOUNTED, L"VFS path already mounted" }
     39    { ERR::VFS_DIR_NOT_FOUND, L"VFS directory not found", 0 },
     40    { ERR::VFS_FILE_NOT_FOUND, L"VFS file not found", 0 },
     41    { ERR::VFS_ALREADY_MOUNTED, L"VFS path already mounted", 0 }
    4242};
    4343STATUS_ADD_DEFINITIONS(vfsStatusDefinitions);
    4444
  • source/lib/path.cpp

    diff --git a/source/lib/path.cpp b/source/lib/path.cpp
    index d4056e1..1c1c44c 100644
    a b  
    3131#include <cerrno>
    3232
    3333static const StatusDefinition pathStatusDefinitions[] = {
    34     { ERR::PATH_CHARACTER_ILLEGAL, L"illegal path character" },
    35     { ERR::PATH_CHARACTER_UNSAFE, L"unsafe path character" },
    36     { ERR::PATH_NOT_FOUND, L"path not found" },
    37     { ERR::PATH_MIXED_SEPARATORS, L"path contains both slash and backslash separators" }
     34    { ERR::PATH_CHARACTER_ILLEGAL, L"illegal path character", 0 },
     35    { ERR::PATH_CHARACTER_UNSAFE, L"unsafe path character", 0 },
     36    { ERR::PATH_NOT_FOUND, L"path not found", 0 },
     37    { ERR::PATH_MIXED_SEPARATORS, L"path contains both slash and backslash separators", 0 }
    3838};
    3939STATUS_ADD_DEFINITIONS(pathStatusDefinitions);
    4040
  • source/lib/res/h_mgr.cpp

    diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp
    index ffae058..8e5bc26 100644
    a b static const Status H_TYPE_MISMATCH = -120004;  
    4949static const Status H_ALREADY_FREED = -120005;
    5050}
    5151static const StatusDefinition hStatusDefinitions[] = {
    52     { ERR::H_IDX_INVALID,   L"Handle index completely out of bounds" },
    53     { ERR::H_IDX_UNUSED,    L"Handle index exceeds high-water mark" },
    54     { ERR::H_TAG_MISMATCH,  L"Handle tag mismatch (stale reference?)" },
    55     { ERR::H_TYPE_MISMATCH, L"Handle type mismatch" },
    56     { ERR::H_ALREADY_FREED, L"Handle already freed" }
     52    { ERR::H_IDX_INVALID,   L"Handle index completely out of bounds", 0 },
     53    { ERR::H_IDX_UNUSED,    L"Handle index exceeds high-water mark", 0 },
     54    { ERR::H_TAG_MISMATCH,  L"Handle tag mismatch (stale reference?)", 0 },
     55    { ERR::H_TYPE_MISMATCH, L"Handle type mismatch", 0 },
     56    { ERR::H_ALREADY_FREED, L"Handle already freed", 0 }
    5757};
    5858STATUS_ADD_DEFINITIONS(hStatusDefinitions);
    5959
  • source/lib/secure_crt.inl

    diff --git a/source/lib/secure_crt.inl b/source/lib/secure_crt.inl
    index 861c189..5a9360c 100644
    a b  
    4040// must only be done once.
    4141#ifndef WSECURE_CRT
    4242static const StatusDefinition secureCrtStatusDefinitions[] = {
    43     { ERR::STRING_NOT_TERMINATED, L"Invalid string (no 0 terminator found in buffer)" }
     43        { ERR::STRING_NOT_TERMINATED, L"Invalid string (no 0 terminator found in buffer)", 0 }
    4444};
    4545STATUS_ADD_DEFINITIONS(secureCrtStatusDefinitions);
    4646#endif
  • source/lib/status.cpp

    diff --git a/source/lib/status.cpp b/source/lib/status.cpp
    index f1b814f..81e70d4 100644
    a b static const StatusDefinition statusDefs[] = {  
    117117
    118118// INFO::OK doesn't really need a string because calling StatusDescription(0)
    119119// should never happen, but we'll play it safe.
    120 { INFO::OK,             L"No error reported here" },
    121 { ERR::FAIL,            L"Function failed (no details available)" },
     120{ INFO::OK,             L"No error reported here", 0 },
     121{ ERR::FAIL,            L"Function failed (no details available)", 0 },
    122122
    123 { INFO::SKIPPED,        L"Skipped (not an error)" },
    124 { INFO::CANNOT_HANDLE,  L"Cannot handle (not an error)" },
    125 { INFO::ALL_COMPLETE,   L"All complete (not an error)" },
     123{ INFO::SKIPPED,        L"Skipped (not an error)", 0 },
     124{ INFO::CANNOT_HANDLE,  L"Cannot handle (not an error)", 0 },
     125{ INFO::ALL_COMPLETE,   L"All complete (not an error)", 0 },
    126126
    127 { ERR::LOGIC,           L"Logic error in code" },
    128 { ERR::EXCEPTION,       L"Caught an exception" },
    129 { ERR::TIMED_OUT,       L"Timed out" },
    130 { ERR::REENTERED,       L"Single-call function was reentered" },
    131 { ERR::CORRUPTED,       L"File/memory data is corrupted" },
    132 { ERR::ABORTED,         L"Operation aborted" },
     127{ ERR::LOGIC,           L"Logic error in code", 0 },
     128{ ERR::EXCEPTION,       L"Caught an exception", 0 },
     129{ ERR::TIMED_OUT,       L"Timed out", 0 },
     130{ ERR::REENTERED,       L"Single-call function was reentered", 0 },
     131{ ERR::CORRUPTED,       L"File/memory data is corrupted", 0 },
     132{ ERR::ABORTED,         L"Operation aborted", 0 },
    133133
    134134{ ERR::INVALID_ALIGNMENT, L"Invalid alignment", EINVAL },
    135135{ ERR::INVALID_OFFSET,    L"Invalid offset",    EINVAL },
    static const StatusDefinition statusDefs[] = {  
    145145{ ERR::NOT_SUPPORTED,   L"Function not supported", ENOSYS },
    146146{ ERR::NO_MEM,          L"Not enough memory", ENOMEM},
    147147
    148 { ERR::_1, L"Case 1" },
    149 { ERR::_2, L"Case 2" },
    150 { ERR::_3, L"Case 3" },
    151 { ERR::_4, L"Case 4" },
    152 { ERR::_5, L"Case 5" },
    153 { ERR::_6, L"Case 6" },
    154 { ERR::_7, L"Case 7" },
    155 { ERR::_8, L"Case 8" },
    156 { ERR::_9, L"Case 9" },
    157 { ERR::_11, L"Case 11" },
    158 { ERR::_12, L"Case 12" },
    159 { ERR::_13, L"Case 13" },
    160 { ERR::_14, L"Case 14" },
    161 { ERR::_15, L"Case 15" },
    162 { ERR::_16, L"Case 16" },
    163 { ERR::_17, L"Case 17" },
    164 { ERR::_18, L"Case 18" },
    165 { ERR::_19, L"Case 19" },
    166 { ERR::_21, L"Case 21" },
    167 { ERR::_22, L"Case 22" },
    168 { ERR::_23, L"Case 23" },
    169 { ERR::_24, L"Case 24" },
    170 { ERR::_25, L"Case 25" },
    171 { ERR::_26, L"Case 26" },
    172 { ERR::_27, L"Case 27" },
    173 { ERR::_28, L"Case 28" },
    174 { ERR::_29, L"Case 29" }
     148{ ERR::_1, L"Case 1", 0 },
     149{ ERR::_2, L"Case 2", 0 },
     150{ ERR::_3, L"Case 3", 0 },
     151{ ERR::_4, L"Case 4", 0 },
     152{ ERR::_5, L"Case 5", 0 },
     153{ ERR::_6, L"Case 6", 0 },
     154{ ERR::_7, L"Case 7", 0 },
     155{ ERR::_8, L"Case 8", 0 },
     156{ ERR::_9, L"Case 9", 0 },
     157{ ERR::_11, L"Case 11", 0 },
     158{ ERR::_12, L"Case 12", 0 },
     159{ ERR::_13, L"Case 13", 0 },
     160{ ERR::_14, L"Case 14", 0 },
     161{ ERR::_15, L"Case 15", 0 },
     162{ ERR::_16, L"Case 16", 0 },
     163{ ERR::_17, L"Case 17", 0 },
     164{ ERR::_18, L"Case 18", 0 },
     165{ ERR::_19, L"Case 19", 0 },
     166{ ERR::_21, L"Case 21", 0 },
     167{ ERR::_22, L"Case 22", 0 },
     168{ ERR::_23, L"Case 23", 0 },
     169{ ERR::_24, L"Case 24", 0 },
     170{ ERR::_25, L"Case 25", 0 },
     171{ ERR::_26, L"Case 26", 0 },
     172{ ERR::_27, L"Case 27", 0 },
     173{ ERR::_28, L"Case 28", 0 },
     174{ ERR::_29, L"Case 29", 0 }
    175175
    176176};
    177177STATUS_ADD_DEFINITIONS(statusDefs);
  • source/lib/tex/tex.cpp

    diff --git a/source/lib/tex/tex.cpp b/source/lib/tex/tex.cpp
    index 57ed5e5..158b391 100644
    a b  
    4040
    4141
    4242static const StatusDefinition texStatusDefinitions[] = {
    43     { ERR::TEX_FMT_INVALID, L"Invalid/unsupported texture format" },
    44     { ERR::TEX_INVALID_COLOR_TYPE, L"Invalid color type" },
    45     { ERR::TEX_NOT_8BIT_PRECISION, L"Not 8-bit channel precision" },
    46     { ERR::TEX_INVALID_LAYOUT, L"Unsupported texel layout, e.g. right-to-left" },
    47     { ERR::TEX_COMPRESSED, L"Unsupported texture compression" },
    48     { WARN::TEX_INVALID_DATA, L"Warning: invalid texel data encountered" },
    49     { ERR::TEX_INVALID_SIZE, L"Texture size is incorrect" },
    50     { INFO::TEX_CODEC_CANNOT_HANDLE, L"Texture codec cannot handle the given format" }
     43    { ERR::TEX_FMT_INVALID, L"Invalid/unsupported texture format", 0 },
     44    { ERR::TEX_INVALID_COLOR_TYPE, L"Invalid color type", 0 },
     45    { ERR::TEX_NOT_8BIT_PRECISION, L"Not 8-bit channel precision", 0 },
     46    { ERR::TEX_INVALID_LAYOUT, L"Unsupported texel layout, e.g. right-to-left", 0 },
     47    { ERR::TEX_COMPRESSED, L"Unsupported texture compression", 0 },
     48    { WARN::TEX_INVALID_DATA, L"Warning: invalid texel data encountered", 0 },
     49    { ERR::TEX_INVALID_SIZE, L"Texture size is incorrect", 0 },
     50    { INFO::TEX_CODEC_CANNOT_HANDLE, L"Texture codec cannot handle the given format", 0 }
    5151};
    5252STATUS_ADD_DEFINITIONS(texStatusDefinitions);
    5353
  • source/lib/utf8.cpp

    diff --git a/source/lib/utf8.cpp b/source/lib/utf8.cpp
    index 31f5c65..7f55ff2 100644
    a b  
    2424#include "lib/utf8.h"
    2525
    2626static const StatusDefinition utf8StatusDefinitions[] = {
    27     { ERR::UTF8_SURROGATE, L"UTF-16 surrogate pairs aren't supported" },
    28     { ERR::UTF8_OUTSIDE_BMP, L"Code point outside BMP (> 0x10000)" },
    29     { ERR::UTF8_NONCHARACTER, L"Noncharacter (e.g. WEOF)" },
    30     { ERR::UTF8_INVALID_UTF8, L"Invalid UTF-8 sequence" }
     27    { ERR::UTF8_SURROGATE, L"UTF-16 surrogate pairs aren't supported", 0 },
     28    { ERR::UTF8_OUTSIDE_BMP, L"Code point outside BMP (> 0x10000)", 0 },
     29    { ERR::UTF8_NONCHARACTER, L"Noncharacter (e.g. WEOF)", 0 },
     30    { ERR::UTF8_INVALID_UTF8, L"Invalid UTF-8 sequence", 0 }
    3131};
    3232STATUS_ADD_DEFINITIONS(utf8StatusDefinitions);
    3333