Skip to content

Commit

Permalink
Revert module_espeak to taking a const pointer
Browse files Browse the repository at this point in the history
This is needeed to keep API compatibility with previous C++ modules,
which would define a function without the const qualifier, thus not
matching the C prototype, and thus getting mangled, and thus the
module_speak weak ref would fail.
  • Loading branch information
sthibaul committed Dec 1, 2021
1 parent e14bb26 commit c163eb7
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/modules/cicero.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ SPDVoice **module_list_voices(void)
return NULL;
}

int module_speak(const gchar * data, size_t bytes, SPDMessageType msgtype)
int module_speak(gchar * data, size_t bytes, SPDMessageType msgtype)
{
DBG("Module speak\n");

Expand Down
2 changes: 1 addition & 1 deletion src/modules/dummy.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ SPDVoice **module_list_voices(void)
return NULL;
}

int module_speak(const gchar * data, size_t bytes, SPDMessageType msgtype)
int module_speak(gchar * data, size_t bytes, SPDMessageType msgtype)
{

DBG("speak()\n");
Expand Down
2 changes: 1 addition & 1 deletion src/modules/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ SPDVoice **module_list_voices(void)
return module_list_registered_voices();
}

int module_speak(const gchar * data, size_t bytes, SPDMessageType msgtype)
int module_speak(gchar * data, size_t bytes, SPDMessageType msgtype)
{
char *tmp;

Expand Down
2 changes: 1 addition & 1 deletion src/modules/module_main.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ int module_init(char **msg);
SPDVoice **module_list_voices(void);

/* Asynchronous Speak */
int module_speak(const char *data, size_t bytes, SPDMessageType msgtype);
int module_speak(char *data, size_t bytes, SPDMessageType msgtype);

/* Synchronous Speak */
void module_speak_sync(const char *data, size_t bytes, SPDMessageType msgtype);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/skeleton0.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ void module_speak_sync(const char *data, size_t bytes, SPDMessageType msgtype)
#else
/* Asynchronous version, when the synthesis implements asynchronous
* processing in another thread. */
int module_speak(const char *data, size_t bytes, SPDMessageType msgtype)
int module_speak(char *data, size_t bytes, SPDMessageType msgtype)
{
/* TODO: Speak the provided data asynchronously in another thread */
fprintf(stderr, "speaking '%s'\n", data);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/skeleton0_espeak-ng-async-server.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int module_loop(void)
static int began;
/* Asynchronous version, when the synthesis implements asynchronous
* processing in another thread. */
int module_speak(const char *data, size_t bytes, SPDMessageType msgtype)
int module_speak(char *data, size_t bytes, SPDMessageType msgtype)
{
/* Speak the provided data asynchronously in another thread */
fprintf(stderr, "speaking '%s'\n", data);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/skeleton0_espeak-ng-async.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int module_loop(void)
static int began;
/* Asynchronous version, when the synthesis implements asynchronous
* processing in another thread. */
int module_speak(const char *data, size_t bytes, SPDMessageType msgtype)
int module_speak(char *data, size_t bytes, SPDMessageType msgtype)
{
/* Speak the provided data asynchronously in another thread */
fprintf(stderr, "speaking '%s'\n", data);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/skeleton_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void module_speak_sync(const char *data, size_t bytes, SPDMessageType msgtype)
#else
/* Asynchronous version, when the synthesis implements asynchronous
* processing in another thread. */
int module_speak(const char *data, size_t bytes, SPDMessageType msgtype)
int module_speak(char *data, size_t bytes, SPDMessageType msgtype)
{
/* Update synth parameters according to message parameters */
UPDATE_PARAMETER(rate, skeleton_set_rate);
Expand Down

0 comments on commit c163eb7

Please sign in to comment.