• R/O
  • SSH
  • HTTPS

ttssh2: コミット


コミットメタ情報

リビジョン7255 (tree)
日時2018-11-04 00:32:41
作者zmatsuo

ログメッセージ

TTXttyrecをコンパイルできるようにした
- gettimeofday()の警告対策

変更サマリ

差分

--- branches/cmake/TTXSamples/CMakeLists.txt (revision 7254)
+++ branches/cmake/TTXSamples/CMakeLists.txt (revision 7255)
@@ -38,11 +38,9 @@
3838 add_subdirectory(TTXtest)
3939 set_target_properties(TTXtest PROPERTIES FOLDER TTXSamples)
4040
41-if(MSVC)
42- add_subdirectory(TTXttyrec)
43- set_target_properties(TTXttyrec PROPERTIES FOLDER TTXSamples)
44- set_target_properties(TTXttyplay PROPERTIES FOLDER TTXSamples)
45-endif(MSVC)
41+add_subdirectory(TTXttyrec)
42+set_target_properties(TTXttyrec PROPERTIES FOLDER TTXSamples)
43+set_target_properties(TTXttyplay PROPERTIES FOLDER TTXSamples)
4644
4745 add_subdirectory(TTXViewMode)
4846 set_target_properties(TTXViewMode PROPERTIES FOLDER TTXSamples)
--- branches/cmake/TTXSamples/TTXttyrec/CMakeLists.txt (revision 7254)
+++ branches/cmake/TTXSamples/TTXttyrec/CMakeLists.txt (revision 7255)
@@ -7,6 +7,12 @@
77 ../../teraterm/common
88 )
99
10+if(MINGW)
11+ link_directories(
12+ ${CMAKE_SOURCE_DIR}/teraterm/htmlhelp
13+ )
14+endif()
15+
1016 add_library(
1117 TTXttyplay SHARED
1218 TTXttyplay.c
--- branches/cmake/TTXSamples/TTXttyrec/TTXttyplay.c (revision 7254)
+++ branches/cmake/TTXSamples/TTXttyrec/TTXttyplay.c (revision 7255)
@@ -10,9 +10,9 @@
1010 #include <winsock2.h>
1111 #include <ws2tcpip.h>
1212
13-#if defined(_MSC_VER)
13+//#if defined(_MSC_VER)
1414 #include "gettimeofday.h"
15-#endif
15+//#endif
1616
1717 #include "compat_w95.h"
1818
@@ -108,7 +108,7 @@
108108 pvar->ChangeTitle = FALSE;
109109 pvar->ReplaceHostDlg = FALSE;
110110 pvar->played = FALSE;
111- gettimeofday(&(pvar->last), NULL);
111+ gettimeofday(&(pvar->last) /*, NULL*/ );
112112 pvar->wait.tv_sec = 0;
113113 pvar->wait.tv_usec = 1;
114114 pvar->pause = FALSE;
@@ -133,11 +133,12 @@
133133
134134 static BOOL PASCAL TTXReadFile(HANDLE fh, LPVOID obuff, DWORD oblen, LPDWORD rbytes, LPOVERLAPPED rol) {
135135 static struct recheader prh = { 0, 0, 0 };
136- static unsigned int lbytes;
136+ static DWORD lbytes;
137137 static char ibuff[BUFFSIZE];
138138 static BOOL title_changed = FALSE, first_title_changed = FALSE;
139139
140- int b[3], rsize;
140+ int b[3];
141+ DWORD rsize;
141142 struct recheader h;
142143 struct timeval curtime;
143144 struct timeval tdiff;
@@ -191,7 +192,7 @@
191192 }
192193
193194 if (!pvar->nowait) {
194- gettimeofday(&curtime, NULL);
195+ gettimeofday(&curtime /*, NULL*/ );
195196 tdiff = tvdiff(pvar->last, curtime);
196197 }
197198
--- branches/cmake/TTXSamples/TTXttyrec/TTXttyrec.c (revision 7254)
+++ branches/cmake/TTXSamples/TTXttyrec/TTXttyrec.c (revision 7255)
@@ -9,9 +9,7 @@
99 #include <winsock2.h>
1010 #include <ws2tcpip.h>
1111
12-#if defined(_MSC_VER)
1312 #include "gettimeofday.h"
14-#endif
1513
1614 #include "compat_w95.h"
1715
@@ -108,9 +106,10 @@
108106
109107 void WriteData(HANDLE fh, char *buff, int len) {
110108 struct timeval t;
111- int b[3], w;
109+ int b[3];
110+ DWORD w;
112111
113- gettimeofday(&t, NULL);
112+ gettimeofday(&t /*, NULL*/ );
114113 b[0] = t.tv_sec;
115114 b[1] = t.tv_usec;
116115 b[2] = len;
--- branches/cmake/TTXSamples/TTXttyrec/gettimeofday.c (revision 7254)
+++ branches/cmake/TTXSamples/TTXttyrec/gettimeofday.c (revision 7255)
@@ -7,11 +7,9 @@
77 #define FTEPOCHDIFF 116444736000000000LL
88 #endif
99
10-int gettimeofday(struct timeval *tv, struct timezone *tz) {
10+int gettimeofday(struct timeval *tv /*, struct timezone *tz*/ ) {
1111 FILETIME ft;
1212 __int64 t;
13- long tzsec;
14- int dst;
1513
1614 if (tv) {
1715 GetSystemTimeAsFileTime(&ft);
@@ -20,7 +18,10 @@
2018 tv->tv_usec = (long)(t % 1000000);
2119 }
2220
21+#if 0
2322 if (tz) {
23+ long tzsec;
24+ int dst;
2425 if (_get_timezone(&tzsec) == 0 && _get_daylight(&dst) == 0) {
2526 tz->tz_minuteswest = tzsec / 60;
2627 tz->tz_dsttime = dst;
@@ -29,6 +30,7 @@
2930 return -1;
3031 }
3132 }
33+#endif
3234
3335 return 0;
3436 }
--- branches/cmake/TTXSamples/TTXttyrec/gettimeofday.h (revision 7254)
+++ branches/cmake/TTXSamples/TTXttyrec/gettimeofday.h (revision 7255)
@@ -10,7 +10,7 @@
1010 };
1111 #endif
1212
13-int gettimeofday(struct timeval *tv, struct timezone *tz);
13+int gettimeofday(struct timeval *tv /*, struct timezone *tz*/ );
1414 struct timeval tvdiff(struct timeval a, struct timeval b);
1515 struct timeval tvshift(struct timeval tv, int shift);
1616 int tvcmp(struct timeval a, struct timeval b);
旧リポジトリブラウザで表示