build until further fixes are made.master
@@ -61,4 +61,4 @@ old_sources = \ | |||||
old/term.c \ | old/term.c \ | ||||
old/widgets.c \ | old/widgets.c \ | ||||
old/widgets.h \ | old/widgets.h \ | ||||
old/wm.c | |||||
old/wm.cpp |
@@ -36,11 +36,39 @@ | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ClInclude Include="neercs.h" /> | <ClInclude Include="neercs.h" /> | ||||
<ClInclude Include="old\mygetopt.h" /> | |||||
<ClInclude Include="old\mytrace.h" /> | |||||
<ClInclude Include="old\neercs.h" /> | |||||
<ClInclude Include="old\python\py_module.h" /> | |||||
<ClInclude Include="old\widgets.h" /> | |||||
<ClInclude Include="video\render.h" /> | <ClInclude Include="video\render.h" /> | ||||
<ClInclude Include="video\text-render.h" /> | <ClInclude Include="video\text-render.h" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ClCompile Include="neercs.cpp" /> | <ClCompile Include="neercs.cpp" /> | ||||
<ClCompile Include="old\actions.c" /> | |||||
<ClCompile Include="old\ansi.c" /> | |||||
<ClCompile Include="old\attach.c" /> | |||||
<ClCompile Include="old\client.c" /> | |||||
<ClCompile Include="old\configuration.c" /> | |||||
<ClCompile Include="old\effects.c" /> | |||||
<ClCompile Include="old\grab.c" /> | |||||
<ClCompile Include="old\help.c" /> | |||||
<ClCompile Include="old\input.c" /> | |||||
<ClCompile Include="old\lock.c" /> | |||||
<ClCompile Include="old\main.c" /> | |||||
<ClCompile Include="old\mygetopt.c" /> | |||||
<ClCompile Include="old\mytrace.c" /> | |||||
<ClCompile Include="old\python\interpreter.c" /> | |||||
<ClCompile Include="old\python\py_module.c" /> | |||||
<ClCompile Include="old\recurrent.c" /> | |||||
<ClCompile Include="old\screens.c" /> | |||||
<ClCompile Include="old\screensaver.c" /> | |||||
<ClCompile Include="old\screen_list.c" /> | |||||
<ClCompile Include="old\server.c" /> | |||||
<ClCompile Include="old\term.c" /> | |||||
<ClCompile Include="old\widgets.c" /> | |||||
<ClCompile Include="old\wm.cpp" /> | |||||
<ClCompile Include="video\render.cpp" /> | <ClCompile Include="video\render.cpp" /> | ||||
<ClCompile Include="video\text-render.cpp" /> | <ClCompile Include="video\text-render.cpp" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
@@ -8,6 +8,75 @@ | |||||
<ClCompile Include="video\text-render.cpp"> | <ClCompile Include="video\text-render.cpp"> | ||||
<Filter>video</Filter> | <Filter>video</Filter> | ||||
</ClCompile> | </ClCompile> | ||||
<ClCompile Include="old\actions.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\ansi.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\attach.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\client.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\configuration.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\effects.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\grab.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\help.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\input.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\lock.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\main.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\mygetopt.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\mytrace.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\recurrent.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\screen_list.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\screens.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\screensaver.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\server.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\term.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\widgets.c"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\wm.cpp"> | |||||
<Filter>old</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\python\interpreter.c"> | |||||
<Filter>old\python</Filter> | |||||
</ClCompile> | |||||
<ClCompile Include="old\python\py_module.c"> | |||||
<Filter>old\python</Filter> | |||||
</ClCompile> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<ClInclude Include="neercs.h" /> | <ClInclude Include="neercs.h" /> | ||||
@@ -17,11 +86,32 @@ | |||||
<ClInclude Include="video\text-render.h"> | <ClInclude Include="video\text-render.h"> | ||||
<Filter>video</Filter> | <Filter>video</Filter> | ||||
</ClInclude> | </ClInclude> | ||||
<ClInclude Include="old\mygetopt.h"> | |||||
<Filter>old</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="old\mytrace.h"> | |||||
<Filter>old</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="old\neercs.h"> | |||||
<Filter>old</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="old\widgets.h"> | |||||
<Filter>old</Filter> | |||||
</ClInclude> | |||||
<ClInclude Include="old\python\py_module.h"> | |||||
<Filter>old\python</Filter> | |||||
</ClInclude> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<Filter Include="video"> | <Filter Include="video"> | ||||
<UniqueIdentifier>{8598edd6-ce35-4250-b16e-4237b34ebd2a}</UniqueIdentifier> | <UniqueIdentifier>{8598edd6-ce35-4250-b16e-4237b34ebd2a}</UniqueIdentifier> | ||||
</Filter> | </Filter> | ||||
<Filter Include="old"> | |||||
<UniqueIdentifier>{ac200501-b60f-4451-9005-a29f3cf9bf75}</UniqueIdentifier> | |||||
</Filter> | |||||
<Filter Include="old\python"> | |||||
<UniqueIdentifier>{9140687d-c5b2-4302-8121-9b12ebf3908e}</UniqueIdentifier> | |||||
</Filter> | |||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
<LolFxCompile Include="video\blurh.lolfx"> | <LolFxCompile Include="video\blurh.lolfx"> | ||||
@@ -12,7 +12,10 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#include <caca.h> | #include <caca.h> | ||||
#include <errno.h> | #include <errno.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -11,7 +11,15 @@ | |||||
* To Public License, Version 2, as published by Sam Hocevar. See | * To Public License, Version 2, as published by Sam Hocevar. See | ||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if defined _MSC_VER | |||||
# define inline __inline | |||||
#endif | |||||
#include <string.h> | #include <string.h> | ||||
#include <caca.h> | #include <caca.h> | ||||
#include "neercs.h" | #include "neercs.h" | ||||
@@ -533,9 +541,9 @@ long int import_term(struct screen_list *screen_list, struct screen *sc, | |||||
/* FIXME better parsing */ | /* FIXME better parsing */ | ||||
if (buffer[i + 2] == '?') | if (buffer[i + 2] == '?') | ||||
{ | { | ||||
char arg[5]; | |||||
char arg[5], *end; | |||||
int a = 0; | int a = 0; | ||||
int c, p; | |||||
int c, p, Pm; | |||||
for (p = 0; p < 4; p++) | for (p = 0; p < 4; p++) | ||||
{ | { | ||||
if (buffer[i + 3 + p] >= '0' | if (buffer[i + 3 + p] >= '0' | ||||
@@ -551,8 +559,7 @@ long int import_term(struct screen_list *screen_list, struct screen *sc, | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
char *end; | |||||
int Pm = strtol(arg, &end, 10); | |||||
Pm = strtol(arg, &end, 10); | |||||
c = buffer[i + 3 + (end - arg)]; | c = buffer[i + 3 + (end - arg)]; | ||||
@@ -878,7 +885,7 @@ long int import_term(struct screen_list *screen_list, struct screen *sc, | |||||
skip += final; | skip += final; | ||||
string = malloc(final - (semicolon + 1) + 1); | |||||
string = (char *)malloc(final - (semicolon + 1) + 1); | |||||
memcpy(string, buffer + i + (semicolon + 1), | memcpy(string, buffer + i + (semicolon + 1), | ||||
final - (semicolon + 1)); | final - (semicolon + 1)); | ||||
string[final - (semicolon + 1)] = '\0'; | string[final - (semicolon + 1)] = '\0'; | ||||
@@ -12,6 +12,12 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <glob.h> | #include <glob.h> | ||||
@@ -27,7 +33,6 @@ | |||||
#include <caca.h> | #include <caca.h> | ||||
#include "config.h" | |||||
#include "neercs.h" | #include "neercs.h" | ||||
char *build_socket_path(char *socket_dir, char *session_name, | char *build_socket_path(char *socket_dir, char *session_name, | ||||
@@ -422,3 +427,4 @@ void attach(struct screen_list *screen_list) | |||||
} | } | ||||
} | } | ||||
#endif |
@@ -12,7 +12,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -296,3 +300,6 @@ int mainloop_tick(char **pbuf, struct screen_list *screen_list) | |||||
return 1; | return 1; | ||||
} | } | ||||
#endif | |||||
@@ -11,6 +11,12 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <fcntl.h> | #include <fcntl.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -566,3 +572,6 @@ char *get_delay(struct screen_list *screen_list) | |||||
sprintf(r, "%d", screen_list->requested_delay); | sprintf(r, "%d", screen_list->requested_delay); | ||||
return r; | return r; | ||||
} | } | ||||
#endif | |||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -276,3 +280,6 @@ int close_screen_recurrent(struct screen_list *screen_list, | |||||
screen_list->changed = 1; | screen_list->changed = 1; | ||||
return 1; | return 1; | ||||
} | } | ||||
#endif | |||||
@@ -10,7 +10,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#define _XOPEN_SOURCE 500 /* getsid() */ | #define _XOPEN_SOURCE 500 /* getsid() */ | ||||
@@ -391,3 +395,6 @@ long select_process(struct screen_list *screen_list) | |||||
} | } | ||||
return ret; | return ret; | ||||
} | } | ||||
#endif | |||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -74,3 +78,5 @@ void draw_help(struct screen_list *screen_list) | |||||
caca_printf(screen_list->cv, x, y++, ""); | caca_printf(screen_list->cv, x, y++, ""); | ||||
caca_printf(screen_list->cv, x, y, "See http://caca.zoy.org/wiki/neercs for more informations"); | caca_printf(screen_list->cv, x, y, "See http://caca.zoy.org/wiki/neercs for more informations"); | ||||
} | } | ||||
#endif |
@@ -11,7 +11,11 @@ | |||||
* To Public License, Version 2, as published by Sam Hocevar. See | * To Public License, Version 2, as published by Sam Hocevar. See | ||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#include <caca.h> | #include <caca.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "neercs.h" | #include "neercs.h" | ||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -219,3 +223,5 @@ int validate_lock(struct screen_list *screen_list, char *user, char *pass) | |||||
return 1; | return 1; | ||||
} | } | ||||
#endif |
@@ -12,7 +12,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -26,8 +30,6 @@ | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <time.h> | #include <time.h> | ||||
#if !defined HAVE_GETOPT_LONG | #if !defined HAVE_GETOPT_LONG | ||||
# include "mygetopt.h" | # include "mygetopt.h" | ||||
#elif defined HAVE_GETOPT_H | #elif defined HAVE_GETOPT_H | ||||
@@ -322,3 +324,6 @@ int handle_command_line(int argc, char *argv[], | |||||
} | } | ||||
return s; | return s; | ||||
} | } | ||||
#endif | |||||
@@ -15,7 +15,9 @@ | |||||
* mygetopt.c: getopt_long reimplementation | * mygetopt.c: getopt_long reimplementation | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -44,7 +46,7 @@ int mygetopt(int argc, char *const _argv[], const char *optstring, | |||||
if (flag[0] == '-' && flag[1] != '-') | if (flag[0] == '-' && flag[1] != '-') | ||||
{ | { | ||||
char *tmp; | |||||
char const *tmp; | |||||
int ret = flag[1]; | int ret = flag[1]; | ||||
if (ret == '\0') | if (ret == '\0') | ||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <errno.h> | #include <errno.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
@@ -783,3 +787,6 @@ static void print_registers(pid_t pid) | |||||
#endif /* DEBUG */ | #endif /* DEBUG */ | ||||
#endif /* USE_GRAB */ | #endif /* USE_GRAB */ | ||||
#endif /* _WIN32 */ | |||||
@@ -10,6 +10,8 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#if !defined _WIN32 | |||||
#include <termios.h> | #include <termios.h> | ||||
struct mytrace; | struct mytrace; | ||||
@@ -31,3 +33,5 @@ int mytrace_exec(struct mytrace *t, char const *command); | |||||
int mytrace_tcgets(struct mytrace *t, int fd, struct termios *tos); | int mytrace_tcgets(struct mytrace *t, int fd, struct termios *tos); | ||||
int mytrace_tcsets(struct mytrace *t, int fd, struct termios *tos); | int mytrace_tcsets(struct mytrace *t, int fd, struct termios *tos); | ||||
int mytrace_sctty(struct mytrace *t, int fd); | int mytrace_sctty(struct mytrace *t, int fd); | ||||
#endif |
@@ -10,7 +10,9 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#ifdef USE_PYTHON | #ifdef USE_PYTHON | ||||
@@ -10,7 +10,9 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#ifdef USE_PYTHON | #ifdef USE_PYTHON | ||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -110,3 +114,5 @@ int remove_recurrent(struct recurrent_list *list, int n) | |||||
list->count--; | list->count--; | ||||
return 0; | return 0; | ||||
} | } | ||||
#endif |
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -214,3 +218,6 @@ void free_screen_list(struct screen_list *screen_list) | |||||
free(screen_list); | free(screen_list); | ||||
} | } | ||||
#endif | |||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -332,3 +336,6 @@ int update_screens_contents(struct screen_list *screen_list) | |||||
} | } | ||||
return refresh; | return refresh; | ||||
} | } | ||||
#endif | |||||
@@ -11,7 +11,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -185,3 +189,5 @@ void screensaver_flying_toasters(struct screen_list *screen_list) | |||||
d->s[i] = ((d->s[i] + 24) % (3 * PRECISION)); | d->s[i] = ((d->s[i] + 24) % (3 * PRECISION)); | ||||
} | } | ||||
} | } | ||||
#endif |
@@ -12,7 +12,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -678,3 +682,5 @@ long long get_us(void) | |||||
gettimeofday(&tv, NULL); | gettimeofday(&tv, NULL); | ||||
return (tv.tv_sec * (1000000) + tv.tv_usec); | return (tv.tv_sec * (1000000) + tv.tv_usec); | ||||
} | } | ||||
#endif |
@@ -10,7 +10,11 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if !defined _WIN32 | |||||
#define _XOPEN_SOURCE | #define _XOPEN_SOURCE | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -131,3 +135,6 @@ int update_terms(struct screen_list *screen_list) | |||||
} | } | ||||
return refresh; | return refresh; | ||||
} | } | ||||
#endif | |||||
@@ -18,7 +18,7 @@ static void widget_ibox_del_char(struct input_box *box); | |||||
struct input_box *widget_ibox_init(caca_canvas_t *cv, int w, int h) | struct input_box *widget_ibox_init(caca_canvas_t *cv, int w, int h) | ||||
{ | { | ||||
struct input_box *box = malloc(sizeof(struct input_box)); | |||||
struct input_box *box = (struct input_box *)malloc(sizeof(struct input_box)); | |||||
if (!box) | if (!box) | ||||
return NULL; | return NULL; | ||||
box->cv = cv; | box->cv = cv; | ||||
@@ -10,7 +10,9 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -11,19 +11,33 @@ | |||||
* http://sam.zoy.org/wtfpl/COPYING for more details. | * http://sam.zoy.org/wtfpl/COPYING for more details. | ||||
*/ | */ | ||||
#include "config.h" | |||||
#if defined HAVE_CONFIG_H | |||||
# include "config.h" | |||||
#endif | |||||
#if defined _XBOX | |||||
# define _USE_MATH_DEFINES /* for M_PI */ | |||||
# include <xtl.h> | |||||
# undef near /* Fuck Microsoft */ | |||||
# undef far /* Fuck Microsoft again */ | |||||
#elif defined _WIN32 | |||||
# define _USE_MATH_DEFINES /* for M_PI */ | |||||
# define WIN32_LEAN_AND_MEAN | |||||
# include <windows.h> | |||||
#endif | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <math.h> | #include <math.h> | ||||
#include <caca.h> | #include <caca.h> | ||||
#include "core.h" | |||||
#include "neercs.h" | #include "neercs.h" | ||||
void resize_screen(struct screen *s, int w, int h) | void resize_screen(struct screen *s, int w, int h) | ||||
{ | { | ||||
caca_canvas_t *old, *new; | |||||
caca_canvas_t *oldc, *newc; | |||||
if (w == s->w && h == s->h) | if (w == s->w && h == s->h) | ||||
return; | return; | ||||
@@ -39,12 +53,12 @@ void resize_screen(struct screen *s, int w, int h) | |||||
* caca_set_canvas_boundaries() is bugged as hell, so let's resize it by | * caca_set_canvas_boundaries() is bugged as hell, so let's resize it by | ||||
* hands | * hands | ||||
*/ | */ | ||||
old = s->cv; | |||||
new = caca_create_canvas(w, h); | |||||
caca_blit(new, 0, 0, old, NULL); | |||||
s->cv = new; | |||||
caca_gotoxy(new, caca_get_cursor_x(old), caca_get_cursor_y(old)); | |||||
caca_free_canvas(old); | |||||
oldc = s->cv; | |||||
newc = caca_create_canvas(w, h); | |||||
caca_blit(newc, 0, 0, oldc, NULL); | |||||
s->cv = newc; | |||||
caca_gotoxy(newc, caca_get_cursor_x(oldc), caca_get_cursor_y(oldc)); | |||||
caca_free_canvas(oldc); | |||||
set_tty_size(s->fd, w, h); | set_tty_size(s->fd, w, h); | ||||
s->orig_w = s->w; | s->orig_w = s->w; | ||||
@@ -446,8 +460,8 @@ void wm_refresh_cube(struct screen_list *screen_list) | |||||
if (screen_list->cube.side == 1) | if (screen_list->cube.side == 1) | ||||
angle = -angle; | angle = -angle; | ||||
float sina = sin(angle); | |||||
float cosa = cos(angle); | |||||
float sina = lol::sin(angle); | |||||
float cosa = lol::cos(angle); | |||||
for (i = 0; i < 12; i++) | for (i = 0; i < 12; i++) | ||||
{ | { |