summaryrefslogtreecommitdiffstats
path: root/noatun-plugins/tyler/file.cpp
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2021-12-31 12:15:57 +0100
committerSlávek Banko <slavek.banko@axis.cz>2021-12-31 12:15:57 +0100
commit762bfec2c849854fc0247acf8d2f107c27b17940 (patch)
treedddce1b148241162ab70667fcd28cd421c7c8f14 /noatun-plugins/tyler/file.cpp
parentc3d0b8b21f6a174cd45213b6c3dcd85b203aafaa (diff)
downloadtdeaddons-762bfec2c849854fc0247acf8d2f107c27b17940.tar.gz
tdeaddons-762bfec2c849854fc0247acf8d2f107c27b17940.zip
Add option WITH_GCC_VISIBILITY.
Fix building with hidden visibility. Add missing definitions to config.h.cmake. Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'noatun-plugins/tyler/file.cpp')
-rw-r--r--noatun-plugins/tyler/file.cpp65
1 files changed, 42 insertions, 23 deletions
diff --git a/noatun-plugins/tyler/file.cpp b/noatun-plugins/tyler/file.cpp
index 432a7be..79fb663 100644
--- a/noatun-plugins/tyler/file.cpp
+++ b/noatun-plugins/tyler/file.cpp
@@ -39,43 +39,62 @@ static TQString getSavePath(void)
return dirs.saveLocation("data", "noatun/") + "tylerstates";
}
-extern "C" void save_effect(t_effect *effect)
+extern "C"
{
- TQFile file(getSavePath());
- if(!file.open(IO_WriteOnly))
- return;
+ KDE_EXPORT void save_effect(t_effect *effect)
+ {
+ TQFile file(getSavePath());
+ if(!file.open(IO_WriteOnly))
+ {
+ return;
+ }
- for(unsigned i = 0; i < sizeof(t_effect); i++)
- file.putch( *((byte *)effect + i) );
+ for(unsigned i = 0; i < sizeof(t_effect); i++)
+ {
+ file.putch( *((byte *)effect + i) );
+ }
+ }
}
t_effect effects[100];
int nb_effects=0;
-extern "C" void load_effects()
+extern "C"
{
- TQFile file(getDataPath());
- if(!file.open(IO_ReadOnly))
- exit(1);
-
- unsigned int i;
- nb_effects = 0;
- while(!file.atEnd())
+ KDE_EXPORT void load_effects()
{
- byte* ptr_effect = (byte *)&effects[nb_effects++];
- for(i = 0; i < sizeof(t_effect); i++)
- ptr_effect[i] = file.getch();
+ TQFile file(getDataPath());
+ if(!file.open(IO_ReadOnly))
+ {
+ exit(1);
+ }
+
+ unsigned int i;
+ nb_effects = 0;
+ while(!file.atEnd())
+ {
+ byte* ptr_effect = (byte *)&effects[nb_effects++];
+ for(i = 0; i < sizeof(t_effect); i++)
+ {
+ ptr_effect[i] = file.getch();
+ }
+ }
}
}
-extern "C" void load_random_effect(t_effect *effect)
+extern "C"
{
- if(nb_effects > 0)
+ KDE_EXPORT void load_random_effect(t_effect *effect)
{
- int num_effect = rand() % nb_effects;
- unsigned int i;
+ if(nb_effects > 0)
+ {
+ int num_effect = rand() % nb_effects;
+ unsigned int i;
- for(i = 0; i < sizeof(t_effect) ; i++)
- *((byte*)effect+i)=*((byte*)(&effects[num_effect])+i);
+ for(i = 0; i < sizeof(t_effect) ; i++)
+ {
+ *((byte*)effect+i) = *((byte*)(&effects[num_effect])+i);
+ }
+ }
}
}