Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMake: error out on warnings for strict/missing prototypes. #1462

Merged
merged 1 commit into from
Mar 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
# set(CMAKE_C_FLAGS "-Wall -std=c99 ${CMAKE_C_FLAGS}") # FIXME: this setting prevented us from setting a coverage build.
# Do not use ffast-math for all build, it would produce incorrect results, only set for release:
set(OPENJPEG_LIBRARY_COMPILE_OPTIONS ${OPENJPEG_LIBRARY_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>")
set(OPENJP2_COMPILE_OPTIONS ${OPENJP2_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>" -Wall -Wextra -Wconversion -Wunused-parameter -Wdeclaration-after-statement -Werror=declaration-after-statement)
set(OPENJP2_COMPILE_OPTIONS ${OPENJP2_COMPILE_OPTIONS} "$<$<CONFIG:Release>:-ffast-math>" -Wall -Wextra -Wconversion -Wunused-parameter -Wdeclaration-after-statement -Werror=declaration-after-statement -Wstrict-prototypes -Werror=strict-prototypes -Wmissing-prototypes -Werror=missing-prototypes)
endif()

#-----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/bin/jp2/opj_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,7 +1883,7 @@ static void info_callback(const char *msg, void *client_data)
fprintf(stdout, "[INFO] %s", msg);
}

OPJ_FLOAT64 opj_clock(void)
static OPJ_FLOAT64 opj_clock(void)
{
#ifdef _WIN32
/* _WIN32: use QueryPerformance (very accurate) */
Expand Down
2 changes: 1 addition & 1 deletion src/bin/jp2/opj_decompress.c
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ int parse_DA_values(char* inArg, unsigned int *DA_x0, unsigned int *DA_y0,
}
}

OPJ_FLOAT64 opj_clock(void)
static OPJ_FLOAT64 opj_clock(void)
{
#ifdef _WIN32
/* _WIN32: use QueryPerformance (very accurate) */
Expand Down
20 changes: 20 additions & 0 deletions src/lib/openjp2/ht_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,26 @@ static OPJ_BOOL opj_t1_allocate_buffers(
return OPJ_TRUE;
}

/**
Decode 1 HT code-block
@param t1 T1 handle
@param cblk Code-block coding parameters
@param orient
@param roishift Region of interest shifting value
@param cblksty Code-block style
@param p_manager the event manager
@param p_manager_mutex mutex for the event manager
@param check_pterm whether PTERM correct termination should be checked
*/
OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
opj_tcd_cblk_dec_t* cblk,
OPJ_UINT32 orient,
OPJ_UINT32 roishift,
OPJ_UINT32 cblksty,
opj_event_mgr_t *p_manager,
opj_mutex_t* p_manager_mutex,
OPJ_BOOL check_pterm);

//************************************************************************/
/** @brief Decodes one codeblock, processing the cleanup, siginificance
* propagation, and magnitude refinement pass
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -6726,7 +6726,7 @@ OPJ_BOOL opj_j2k_set_threads(opj_j2k_t *j2k, OPJ_UINT32 num_threads)
return OPJ_FALSE;
}

static int opj_j2k_get_default_thread_count()
static int opj_j2k_get_default_thread_count(void)
{
const char* num_threads_str = getenv("OPJ_NUM_THREADS");
int num_cpus;
Expand Down
5 changes: 5 additions & 0 deletions src/lib/openjp2/openjpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ static void opj_close_from_file(void* p_user_data)
/* ---------------------------------------------------------------------- */
#ifdef _WIN32
#ifndef OPJ_STATIC

/* declaration to avoid warning: no previous prototype for 'DllMain' */
BOOL APIENTRY
DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved);

BOOL APIENTRY
DllMain(HINSTANCE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
{
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ struct opj_thread_t {
HANDLE hThread;
};

unsigned int __stdcall opj_thread_callback_adapter(void *info)
static unsigned int __stdcall opj_thread_callback_adapter(void *info)
{
opj_thread_t* thread = (opj_thread_t*) info;
HANDLE hEvent = NULL;
Expand Down