Remove build type hardcode spec.

Also add QPMS_NORETURN attribute/macro.


Former-commit-id: 0a3fa2ecb35e8ffcee698c98553577ab2bb513b0
This commit is contained in:
Marek Nečada 2020-01-28 18:10:52 +02:00
parent c7c27c4731
commit c11fe19af3
4 changed files with 10 additions and 6 deletions

View File

@ -5,8 +5,6 @@ include(GNUInstallDirs)
project (QPMS) project (QPMS)
set(CMAKE_BUILD_TYPE Debug)
macro(use_c99) macro(use_c99)
if (CMAKE_VERSION VERSION_LESS "3.1") if (CMAKE_VERSION VERSION_LESS "3.1")
if (CMAKE_C_COMPILER_ID STREQUAL "GNU") if (CMAKE_C_COMPILER_ID STREQUAL "GNU")

View File

@ -19,4 +19,10 @@
#define QPMS_EXPECT(exp,c) (exp) #define QPMS_EXPECT(exp,c) (exp)
#endif #endif
#if (defined(__GNUC__) && __GNUC__ >= 3) || \
(defined(__GNUC__) && defined(__GNUC_MINOR__) && __GNUC__ == 2 && __GNUC_MINOR__ >= 8)
// TODO clang
#define QPMS_NORETURN __attribute__((noreturn))
#endif
#endif // OPTIM_H #endif // OPTIM_H

View File

@ -4,14 +4,14 @@
#include "optim.h" #include "optim.h"
/// Provisional error message with abort(); /// Provisional error message with abort();
void qpms_pr_error(const char *fmt, ...); QPMS_NORETURN void qpms_pr_error(const char *fmt, ...);
//void qpms_error(const char *fmt, ...); //void qpms_error(const char *fmt, ...);
/// Provisional error message with abort(), indicating source and line number. /// Provisional error message with abort(), indicating source and line number.
void qpms_pr_error_at_line(const char *filename, unsigned int linenum, void qpms_pr_error_at_line(const char *filename, unsigned int linenum,
const char *fmt, ...); const char *fmt, ...);
void qpms_pr_error_at_flf(const char *filename, unsigned int linenum, QPMS_NORETURN void qpms_pr_error_at_flf(const char *filename, unsigned int linenum,
const char *func, const char *func,
const char *fmt, ...); const char *fmt, ...);

View File

@ -429,12 +429,12 @@ qpms_errno_t qpms_read_scuff_tmatrix(
switch(PAlpha) { switch(PAlpha) {
case 0: TAlpha = QPMS_VSWF_MAGNETIC; break; case 0: TAlpha = QPMS_VSWF_MAGNETIC; break;
case 1: TAlpha = QPMS_VSWF_ELECTRIC; break; case 1: TAlpha = QPMS_VSWF_ELECTRIC; break;
default: assert(0); default: QPMS_WTF;
} }
switch(PBeta) { switch(PBeta) {
case 0: TBeta = QPMS_VSWF_MAGNETIC; break; case 0: TBeta = QPMS_VSWF_MAGNETIC; break;
case 1: TBeta = QPMS_VSWF_ELECTRIC; break; case 1: TBeta = QPMS_VSWF_ELECTRIC; break;
default: assert(0); default: QPMS_WTF;
} }
qpms_uvswfi_t srcui = qpms_tmn2uvswfi(TAlpha, MAlpha, LAlpha), qpms_uvswfi_t srcui = qpms_tmn2uvswfi(TAlpha, MAlpha, LAlpha),
destui = qpms_tmn2uvswfi(TBeta, MBeta, LBeta); destui = qpms_tmn2uvswfi(TBeta, MBeta, LBeta);