From a82a4547e35c2a7eb063f6fb022b7ee8aa47861c Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 25 Jul 2018 03:51:21 -0400 Subject: [PATCH 1/3] =?UTF-8?q?[Fix]=20=E6=B7=BB=E5=8A=A0gitignore?= =?UTF-8?q?=EF=BC=8C=E5=BF=BD=E7=95=A5=E6=8E=89CMake=E7=9A=84=E4=B8=B4?= =?UTF-8?q?=E6=97=B6=E6=96=87=E4=BB=B6=EF=BC=8C=E8=BF=98=E6=9C=89build/?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitignore b/.gitignore index 02df4f28..aa69fb9b 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,15 @@ Release/ *.log *.bak +# 编译临时文件夹 +build/ + +# CMake临时文件 +CMakeCache.txt +CMakeFiles/ +build/cmake_install.cmake +build/Makefile + # 目录 .idea .vscode From f4f6d6742c3a3cbbdb179d6b84d711884813315e Mon Sep 17 00:00:00 2001 From: nanoric Date: Wed, 25 Jul 2018 05:28:38 -0400 Subject: [PATCH 2/3] =?UTF-8?q?[Fix]=20=E4=BC=98=E5=8C=96=E4=BA=86ctp?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3py=E8=BD=AC=E6=8D=A2=E5=B1=82=E7=9A=84?= =?UTF-8?q?=E6=80=A7=E8=83=BD=20=20=20=20=20=20=201.=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=89=B9=E5=8C=96=E7=89=88=E7=9A=84strcpy=5Fs=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E6=8B=B7=E8=B4=9D=E6=80=A7=E8=83=BD=20=20=20?= =?UTF-8?q?=20=20=20=202.=E9=81=BF=E5=85=8D=E9=87=8D=E5=A4=8D=E7=9A=84stri?= =?UTF-8?q?ng=E6=8B=B7=E8=B4=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.cpp b/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.cpp index df689fb2..231a6520 100644 --- a/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.cpp +++ b/vnpy/api/ctp/vnctpmd/vnctpmd/vnctpmd.cpp @@ -7,7 +7,7 @@ ///´ÓPython¶ÔÏóµ½C++ÀàÐÍת»»Óõĺ¯Êý ///------------------------------------------------------------------------------------- -void getInt(dict d, string key, int *value) +void getInt(dict d, const string &key, int *value) { if (d.has_key(key)) //¼ì²é×ÖµäÖÐÊÇ·ñ´æÔڸüüÖµ { @@ -20,7 +20,7 @@ void getInt(dict d, string key, int *value) } }; -void getDouble(dict d, string key, double *value) +void getDouble(dict d, const string &key, double *value) { if (d.has_key(key)) { @@ -33,7 +33,9 @@ void getDouble(dict d, string key, double *value) } }; -void getStr(dict d, string key, char *value) +// ʹÓÃÌØ»¯µÄstrcpy_s£¬ÄÜÌáÉýÐÔÄÜ +template +void getStr(dict d, const string &key, const CharType(&value)[size]) { if (d.has_key(key)) { @@ -43,18 +45,18 @@ void getStr(dict d, string key, char *value) { string s = x(); const char *buffer = s.c_str(); - //¶Ô×Ö·û´®Ö¸Õ븳ֵ±ØÐëʹÓÃstrcpy_s, vs2013ʹÓÃstrcpy±àÒëͨ²»¹ý - //+1Ó¦¸ÃÊÇÒòΪC++×Ö·û´®µÄ½áβ·ûºÅ£¿²»ÊÇÌرðÈ·¶¨£¬²»¼ÓÕâ¸ö1»á³ö´í #ifdef _MSC_VER //WIN32 - strcpy_s(value, strlen(buffer) + 1, buffer); + strcpy_s(value, buffer); #elif __GNUC__ strncpy(value, buffer, strlen(buffer) + 1); +#else +#pragma error("unsupported compiler") #endif } } -}; +} -void getChar(dict d, string key, char *value) +void getChar(dict d, const string &key, char *value) { if (d.has_key(key)) { From d009f4d86c5ac30c018c316e82f1f33020b24590 Mon Sep 17 00:00:00 2001 From: cclauss Date: Sun, 5 Aug 2018 16:51:03 +0200 Subject: [PATCH 3/3] Travis CI: branches: only: - master - stable --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e5b57753..1b6f9c53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,10 @@ cache: pip python: - 2.7 - 3.6 +branches: + only: + - master + - dev install: - pip install -r requirements.txt - pip install flake8 # pytest # add another testing frameworks later