Skip to content

Commit 0d263c8

Browse files
committed
style: add void parameters to C function declarations and definitions #352
Updated function prototypes and definitions across json, lattice, property, text, trie libraries and samples to include explicit void parameters for functions taking no arguments. Improved code consistency and adherence to C coding standards.
1 parent df77dd8 commit 0d263c8

23 files changed

Lines changed: 42 additions & 42 deletions

library/json/c/include/tetengo/json/element.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,70 +24,70 @@ typedef struct tetengo_json_element_tag tetengo_json_element_t;
2424
2525
\return The type name.
2626
*/
27-
int tetengo_json_element_typeName_string();
27+
int tetengo_json_element_typeName_string(void);
2828

2929
/*!
3030
\brief Returns the type name of number.
3131
3232
\return The type name.
3333
*/
34-
int tetengo_json_element_typeName_number();
34+
int tetengo_json_element_typeName_number(void);
3535

3636
/*!
3737
\brief Returns the type name of boolean.
3838
3939
\return The type name.
4040
*/
41-
int tetengo_json_element_typeName_boolean();
41+
int tetengo_json_element_typeName_boolean(void);
4242

4343
/*!
4444
\brief Returns the type name of null.
4545
4646
\return The type name.
4747
*/
48-
int tetengo_json_element_typeName_null();
48+
int tetengo_json_element_typeName_null(void);
4949

5050
/*!
5151
\brief Returns the type name of object.
5252
5353
\return The type name.
5454
*/
55-
int tetengo_json_element_typeName_object();
55+
int tetengo_json_element_typeName_object(void);
5656

5757
/*!
5858
\brief Returns the type name of member.
5959
6060
\return The type name.
6161
*/
62-
int tetengo_json_element_typeName_member();
62+
int tetengo_json_element_typeName_member(void);
6363

6464
/*!
6565
\brief Returns the type name of array.
6666
6767
\return The type name.
6868
*/
69-
int tetengo_json_element_typeName_array();
69+
int tetengo_json_element_typeName_array(void);
7070

7171
/*!
7272
\brief Returns the type category of primitive.
7373
7474
\return The type category.
7575
*/
76-
int tetengo_json_element_typeCategory_primitive();
76+
int tetengo_json_element_typeCategory_primitive(void);
7777

7878
/*!
7979
\brief Returns the type category of opening structure.
8080
8181
\return The type category.
8282
*/
83-
int tetengo_json_element_typeCategory_structureOpen();
83+
int tetengo_json_element_typeCategory_structureOpen(void);
8484

8585
/*!
8686
\brief Returns the type category of closing structure.
8787
8888
\return The type category.
8989
*/
90-
int tetengo_json_element_typeCategory_structureClose();
90+
int tetengo_json_element_typeCategory_structureClose(void);
9191

9292
/*! The type type. */
9393
typedef struct tetengo_json_element_type_tag

library/json/c/include/tetengo/json/reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ typedef struct tetengo_json_location_tag
4545
4646
\return The default buffer capacity.
4747
*/
48-
size_t tetengo_json_reader_streamReaderDefaultBufferCapacity();
48+
size_t tetengo_json_reader_streamReaderDefaultBufferCapacity(void);
4949

5050
/*!
5151
\brief Creates a stream reader.

library/json/test/src/usage_tetengo.json.parsing_c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
int make_json_file(const char* text, const char* path);
2121
const char* to_string(const tetengo_json_element_t* p_element);
2222

23-
void usage_tetengo_json_parsing()
23+
void usage_tetengo_json_parsing(void)
2424
{
2525
// clang-format off
2626
static const char* const json_text =

library/json/test/src/usage_tetengo.json.parsing_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
extern "C" {
1414
#endif
1515

16-
void usage_tetengo_json_parsing();
16+
void usage_tetengo_json_parsing(void);
1717

1818

1919
#if defined(__cplusplus)

library/lattice/c/include/tetengo/lattice/constraint.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ typedef struct tetengo_lattice_constraint_tag tetengo_lattice_constraint_t;
3030
3131
\return A pointer to an empty constraint.
3232
*/
33-
tetengo_lattice_constraint_t* tetengo_lattice_constraint_createEmpty();
33+
tetengo_lattice_constraint_t* tetengo_lattice_constraint_createEmpty(void);
3434

3535
/*!
3636
\brief Creates a constraint.

library/lattice/c/include/tetengo/lattice/entry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ tetengo_lattice_entry_keyHandle_t tetengo_lattice_entry_toKeyHandle(const teteng
107107
108108
\return The pointer to the BOS/EOS entry.
109109
*/
110-
const tetengo_lattice_entryView_t* tetengo_lattice_entryView_bosEos();
110+
const tetengo_lattice_entryView_t* tetengo_lattice_entryView_bosEos(void);
111111

112112
/*!
113113
\brief Creates an entry view key by a handle.

library/lattice/c/include/tetengo/lattice/path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ typedef struct tetengo_lattice_path_tag tetengo_lattice_path_t;
2727
2828
\return A pointer to a path. Or NULL when p_nodes is NULL.
2929
*/
30-
tetengo_lattice_path_t* tetengo_lattice_path_createEmpty();
30+
tetengo_lattice_path_t* tetengo_lattice_path_createEmpty(void);
3131

3232
/*!
3333
\brief Creates a path.

library/lattice/test/src/usage_tetengo.lattice.viterbi_c.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
#include <tetengo/lattice/vocabulary.h>
2626

2727

28-
tetengo_lattice_vocabulary_t* build_vocabulary();
28+
tetengo_lattice_vocabulary_t* build_vocabulary(void);
2929
const char* to_string(const tetengo_lattice_path_t* p_path);
3030

31-
void usage_tetengo_lattice_viterbi()
31+
void usage_tetengo_lattice_viterbi(void)
3232
{
3333
/*
3434
Makes the following lattice and searches it.
@@ -144,7 +144,7 @@ entry_equal_to(const tetengo_lattice_entryView_t* const p_entry1, const tetengo_
144144
return equality;
145145
}
146146

147-
tetengo_lattice_vocabulary_t* build_vocabulary()
147+
tetengo_lattice_vocabulary_t* build_vocabulary(void)
148148
{
149149
// The contents of the vocabulary.
150150
const tetengo_lattice_input_t* const p_entry_key_a = tetengo_lattice_input_createStringInput("a");

library/lattice/test/src/usage_tetengo.lattice.viterbi_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
extern "C" {
1414
#endif
1515

16-
void usage_tetengo_lattice_viterbi();
16+
void usage_tetengo_lattice_viterbi(void);
1717

1818

1919
#if defined(__cplusplus)

library/property/c/include/tetengo/property/storage.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,21 @@ void tetengo_property_storage_save(const tetengo_property_storage_t* p_storage);
111111
112112
\return A pointer to a storage loader.
113113
*/
114-
tetengo_property_storageLoader_t* tetengo_property_storageLoader_createMemoryStorageLoader();
114+
tetengo_property_storageLoader_t* tetengo_property_storageLoader_createMemoryStorageLoader(void);
115115

116116
/*!
117117
\brief Creates a file storage loader.
118118
119119
\return A pointer to a storage loader.
120120
*/
121-
tetengo_property_storageLoader_t* tetengo_property_storageLoader_createFileStorageLoader();
121+
tetengo_property_storageLoader_t* tetengo_property_storageLoader_createFileStorageLoader(void);
122122

123123
/*!
124124
\brief Creates a Windows registry storage loader.
125125
126126
\return A pointer to a storage loader.
127127
*/
128-
tetengo_property_storageLoader_t* tetengo_property_storageLoader_createWindowsRegistoryStorageLoader();
128+
tetengo_property_storageLoader_t* tetengo_property_storageLoader_createWindowsRegistoryStorageLoader(void);
129129

130130
/*!
131131
\brief Creates a storage loader proxy.

0 commit comments

Comments
 (0)