Skip to content
This repository has been archived by the owner on Jun 2, 2024. It is now read-only.

Commit

Permalink
Multiple fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
seanstone committed Jun 2, 2016
1 parent 25a895d commit 509db2f
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion cfsr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ link_directories(${CMAKE_SOURCE_DIR}/lib)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Ofast -s -static")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -W -pedantic -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Ofast -s -static")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -W -pedantic -Wextra")

# Include headers

Expand All @@ -22,7 +24,7 @@ include_directories("include")

file(GLOB CFSR_SRC "src/*.c")
add_library(cfsr STATIC ${CFSR_SRC})
target_link_libraries(cfsr netcdf.a hdf5_hl.a hdf5.a szip.a z.a curl.a gcc.a) #netcdf_c++4
target_link_libraries(cfsr netcdf.a hdf5_hl.a hdf5.a szip.a z.a curl.a winpthread.a stdc++.a gcc.a winpthread.a) #netcdf_c++4

file(GLOB EXAMPLE_SRC "convert/*.cpp")
add_executable(convert ${EXAMPLE_SRC})
Expand Down
2 changes: 1 addition & 1 deletion html/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ function resetParams()

function newRecord()
{
var projectName = prompt("請輸入專案名稱", "新專案");
var projectName = prompt("請輸入專案名稱", "New");

if (projectName != null)
{
Expand Down
2 changes: 1 addition & 1 deletion include/date.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ struct Date

//Date(int year, int month, int day, int hour) : year(year), month(month), day(day), hour(hour) {}

inline bool leap(int y) { return y%400?true : y%100?false : y%4?true : false; }
inline int leap(int y) { return (!(y%400))?1 : (!(y%100))?0 : (!(y%4))?1 : 0; }
inline int days(int m, int y) { return m==2 ? 28+leap(y) : (m<8 ? m&1:!(m&1)) ? 31 : 30; }

inline Date& operator++()
Expand Down
Binary file modified lib/libcfsr.a
Binary file not shown.
2 changes: 1 addition & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main()
std::cout <<
"\n"
"*************** 帆船軌跡計算程式 ***************\n"
" 2016/5/16\n"
" 2016/6/2\n"
" En Shih (石恩)\n"
"\n";

Expand Down
2 changes: 1 addition & 1 deletion src/voyage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ void Voyage::step()
// adjust boat direction and calculate boat speed gain due to wind
// TODO: path finding
sail_dir = (
mode == WIND ? wind.normalize() :
mode == WIND ? (wind.norm() > 0 ? (wind / wind.norm()) : 0) :
mode == DIRN ? dir :
mode == DEST ? adj_direction(curr, dest).normalize() :
0
Expand Down

0 comments on commit 509db2f

Please sign in to comment.