Commit d9e6e5ab authored by Boudewijn Rempt's avatar Boudewijn Rempt Committed by Boudewijn Rempt

Run astyle-kdelibs on krita/cmake

parent 31b61f43
......@@ -6,36 +6,38 @@
#endif
#include <stdlib.h>
int check( const char* from, const char* to )
int check(const char *from, const char *to)
{
iconv_t myConverter = iconv_open( to, from );
iconv_t myConverter = iconv_open(to, from);
if ( myConverter != (iconv_t)-1 ) {
iconv_close( myConverter );
return 0;
if (myConverter != (iconv_t) - 1) {
iconv_close(myConverter);
return 0;
} else {
return 1;
}
else
return 1;
}
int main(int argc, char** argv)
int main(int argc, char **argv)
{
const char* from[] = { "CP874", "CP932", "CP936", "CP949",
"CP950", "CP1250", "CP1251", "CP1252",
"CP1253", "CP1254", "CP1255", "CP1256",
"CP1257", "koi8-r", 0 };
const char* to[] = { "UNICODELITTLE", "UNICODEBIG", 0 };
const char *from[] = { "CP874", "CP932", "CP936", "CP949",
"CP950", "CP1250", "CP1251", "CP1252",
"CP1253", "CP1254", "CP1255", "CP1256",
"CP1257", "koi8-r", 0
};
const char *to[] = { "UNICODELITTLE", "UNICODEBIG", 0 };
int fromIndex = 0;
int toIndex = 0;
while ( to[ toIndex ] != 0 ) {
while( from[ fromIndex ] != 0 ) {
if ( check( from[ fromIndex ], to[ toIndex ] ) != 0 )
exit( 1 );
fromIndex = fromIndex + 1;
}
toIndex = toIndex + 1;
fromIndex = 0;
while (to[ toIndex ] != 0) {
while (from[ fromIndex ] != 0) {
if (check(from[ fromIndex ], to[ toIndex ]) != 0) {
exit(1);
}
fromIndex = fromIndex + 1;
}
toIndex = toIndex + 1;
fromIndex = 0;
}
exit( 0 );
exit(0);
}
#include <string.h>
#include <zlib.h>
int version[3] = {0,0,0};
int version[3] = {0, 0, 0};
static void decode(char *str)
{
int n;
for (n = 0; n < 3 && str; n++) {
char *pnt = strchr(str, '.');
if (pnt) *pnt++ = '\0';
version[n] = atoi(str);
str = pnt;
int n;
for (n = 0; n < 3 && str; n++) {
char *pnt = strchr(str, '.');
if (pnt) {
*pnt++ = '\0';
}
version[n] = atoi(str);
str = pnt;
}
}
int main(void) {
decode(strdup(zlibVersion()));
return
(version[0] < 1 ||
(version[0] == 1 &&
(version[1] < 1 ||
(version[1] == 1 && version[2] < 4))));
int main(void)
{
decode(strdup(zlibVersion()));
return
(version[0] < 1 ||
(version[0] == 1 &&
(version[1] < 1 ||
(version[1] == 1 && version[2] < 4))));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment