Ver código fonte

Add cast to avoid warning

bel 8 anos atrás
pai
commit
7ee47bbc20
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      src/civetweb.c

+ 2 - 2
src/civetweb.c

@@ -5019,8 +5019,8 @@ pull_all(FILE *fp, struct mg_connection *conn, char *buf, int len)
 			/* timeout */
 			/* timeout */
 			if (timeout > 0.0) {
 			if (timeout > 0.0) {
 				clock_gettime(CLOCK_MONOTONIC, &now);
 				clock_gettime(CLOCK_MONOTONIC, &now);
-				dt = (now.tv_sec - start_time.tv_sec)
-				     + 1.0E-9 * (now.tv_nsec - start_time.tv_nsec);
+				dt = (double)(now.tv_sec - start_time.tv_sec)
+				     + 1.0E-9 * (double)(now.tv_nsec - start_time.tv_nsec);
 				if (dt < timeout) {
 				if (dt < timeout) {
 					continue;
 					continue;
 				}
 				}