Skip to content

Commit

Permalink
(void) for no argument in C
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengxwen committed Apr 10, 2024
1 parent 2d48848 commit 82d71ac
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: gdsfmt
Type: Package
Title: R Interface to CoreArray Genomic Data Structure (GDS) Files
Version: 1.39.2
Date: 2024-03-29
Version: 1.39.3
Date: 2024-04-10
Depends: R (>= 2.15.0), methods
Suggests: parallel, digest, Matrix, crayon, RUnit, knitr, markdown, rmarkdown,
BiocGenerics
Expand Down
14 changes: 7 additions & 7 deletions inst/include/R_GDS.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ extern "C" {
// Error functions

/// get the error message
extern const char *GDS_GetError();
extern const char *GDS_GetError(void);
/// set the error message
extern void GDS_SetError(const char *Msg);

Expand All @@ -335,7 +335,7 @@ extern "C" {
// Functions for parallel computing

/// initialize the mutex object
extern PdThreadMutex GDS_Parallel_InitMutex();
extern PdThreadMutex GDS_Parallel_InitMutex(void);
/// finalize the mutex object
extern void GDS_Parallel_DoneMutex(PdThreadMutex Obj);
/// lock the mutex object
Expand All @@ -348,7 +348,7 @@ extern "C" {
extern void GDS_Parallel_UnlockMutex(PdThreadMutex Obj);

/// initialize the condition object
extern PdThreadCondition GDS_Parallel_InitCondition();
extern PdThreadCondition GDS_Parallel_InitCondition(void);
/// finalize the condition object
extern void GDS_Parallel_DoneCondition(PdThreadCondition Obj);
/// signal a condition object
Expand All @@ -359,7 +359,7 @@ extern "C" {
extern void GDS_Parallel_WaitCondition(PdThreadCondition Obj, PdThreadMutex Mutex);

/// initialize the suspending object
extern PdThreadsSuspending GDS_Parallel_InitSuspend();
extern PdThreadsSuspending GDS_Parallel_InitSuspend(void);
/// finalize the suspending object
extern void GDS_Parallel_DoneSuspend(PdThreadsSuspending Obj);
/// suspend the object
Expand All @@ -377,7 +377,7 @@ extern "C" {
// Functions for machine

/// return the number of available (logical) cores in the system
extern int GDS_Mach_GetNumOfCores();
extern int GDS_Mach_GetNumOfCores(void);
/// return the size in byte of level-n cache memory
extern C_UInt64 GDS_Mach_GetCPULevelCache(int level);

Expand Down Expand Up @@ -405,7 +405,7 @@ extern "C" {
// External packages (requiring >= v1.23.6)

/// load the Matrix package
extern C_BOOL GDS_Load_Matrix();
extern C_BOOL GDS_Load_Matrix(void);
/// create a dgCMatrix R object, length(x)=length(i)=n_x, length(p)=ncol+1
extern SEXP GDS_New_SpCMatrix(const double *x, const int *i, const int *p,
int n_x, int nrow, int ncol);
Expand All @@ -420,7 +420,7 @@ extern "C" {
#ifndef COREARRAY_GDSFMT_PACKAGE

/// initialize GDS interface
extern void Init_GDS_Routines();
extern void Init_GDS_Routines(void);

#endif // COREARRAY_GDSFMT_PACKAGE

Expand Down
30 changes: 15 additions & 15 deletions inst/include/R_GDS2.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//
// R_GDS2.h: C interface to gdsfmt dynamic library
//
// Copyright (C) 2014-2022 Xiuwen Zheng
// Copyright (C) 2014-2024 Xiuwen Zheng
//
// This file is part of CoreArray.
//
Expand All @@ -29,7 +29,7 @@
* \file R_GDS2.h
* \author Xiuwen Zheng [zhengxwen@gmail.com]
* \version 1.0
* \date 2014 - 2022
* \date 2014 - 2024
* \brief C interface to gdsfmt dynamic library
* \details
**/
Expand Down Expand Up @@ -485,9 +485,9 @@ COREARRAY_DLL_LOCAL const void *GDS_Iter_WData(PdIterator I, const void *InBuf,
// ===========================================================================
// functions for error

typedef const char *(*Type_GetError)();
typedef const char *(*Type_GetError)(void);
static Type_GetError func_GetError = NULL;
COREARRAY_DLL_LOCAL const char *GDS_GetError()
COREARRAY_DLL_LOCAL const char *GDS_GetError(void)
{
return (*func_GetError)();
}
Expand All @@ -504,9 +504,9 @@ COREARRAY_DLL_LOCAL void GDS_SetError(const char *Msg)
// ===========================================================================
// functions for parallel computing

typedef PdThreadMutex (*Type_Parallel_InitMutex)();
typedef PdThreadMutex (*Type_Parallel_InitMutex)(void);
static Type_Parallel_InitMutex func_Parallel_InitMutex = NULL;
COREARRAY_DLL_LOCAL PdThreadMutex GDS_Parallel_InitMutex()
COREARRAY_DLL_LOCAL PdThreadMutex GDS_Parallel_InitMutex(void)
{
return (*func_Parallel_InitMutex)();
}
Expand Down Expand Up @@ -539,9 +539,9 @@ COREARRAY_DLL_LOCAL void GDS_Parallel_UnlockMutex(PdThreadMutex Obj)
(*func_Parallel_UnlockMutex)(Obj);
}

typedef PdThreadCondition (*Type_Parallel_InitCondition)();
typedef PdThreadCondition (*Type_Parallel_InitCondition)(void);
static Type_Parallel_InitCondition func_Parallel_InitCondition = NULL;
COREARRAY_DLL_LOCAL PdThreadCondition GDS_Parallel_InitCondition()
COREARRAY_DLL_LOCAL PdThreadCondition GDS_Parallel_InitCondition(void)
{
return (*func_Parallel_InitCondition)();
}
Expand Down Expand Up @@ -573,9 +573,9 @@ COREARRAY_DLL_LOCAL void GDS_Parallel_WaitCondition(PdThreadCondition Obj,
(*func_Parallel_WaitCondition)(Obj, Mutex);
}

typedef PdThreadsSuspending (*Type_Parallel_InitSuspend)();
typedef PdThreadsSuspending (*Type_Parallel_InitSuspend)(void);
static Type_Parallel_InitSuspend func_Parallel_InitSuspend = NULL;
COREARRAY_DLL_LOCAL PdThreadsSuspending GDS_Parallel_InitSuspend()
COREARRAY_DLL_LOCAL PdThreadsSuspending GDS_Parallel_InitSuspend(void)
{
return (*func_Parallel_InitSuspend)();
}
Expand Down Expand Up @@ -614,9 +614,9 @@ COREARRAY_DLL_LOCAL void GDS_Parallel_RunThreads(
// ===========================================================================
// functions for machine

typedef int (*Type_Mach_GetNumOfCores)();
typedef int (*Type_Mach_GetNumOfCores)(void);
static Type_Mach_GetNumOfCores func_Mach_GetNumOfCores = NULL;
COREARRAY_DLL_EXPORT int GDS_Mach_GetNumOfCores()
COREARRAY_DLL_EXPORT int GDS_Mach_GetNumOfCores(void)
{
return (*func_Mach_GetNumOfCores)();
}
Expand Down Expand Up @@ -670,9 +670,9 @@ COREARRAY_DLL_LOCAL void GDS_ArrayRead_BalanceBuffer(PdArrayRead array[],
(*func_ArrayRead_BalanceBuffer)(array, n, buffer_size);
}

typedef C_BOOL (*Type_Load_Matrix)();
typedef C_BOOL (*Type_Load_Matrix)(void);
static Type_Load_Matrix func_Load_Matrix = NULL;
COREARRAY_DLL_LOCAL C_BOOL GDS_Load_Matrix()
COREARRAY_DLL_LOCAL C_BOOL GDS_Load_Matrix(void)
{
return (*func_Load_Matrix)();
}
Expand All @@ -698,7 +698,7 @@ COREARRAY_DLL_LOCAL SEXP GDS_New_SpCMatrix2(SEXP x, SEXP i, SEXP p,
// ===========================================================================

/// initialize the GDS routines
void Init_GDS_Routines()
void Init_GDS_Routines(void)
{
static const char *PKG_GDSFMT = "gdsfmt";

Expand Down
2 changes: 1 addition & 1 deletion src/R_CoreArray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@

#define COREARRAY_GDSFMT_PACKAGE

#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <cstring>
#include <R_GDS_CPP.h>
#include <R_ext/Rdynload.h>

Expand Down

0 comments on commit 82d71ac

Please sign in to comment.