Skip to content

Commit

Permalink
Fix compiler warning
Browse files Browse the repository at this point in the history
Raise verion to 1.3.2
Add reformat make target
  • Loading branch information
badaix committed Apr 23, 2020
1 parent ea6e081 commit 0111fab
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
# \____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_)

# This file is part of jsonrpc++
# Copyright (C) 2017-2019 Johannes Pohl
# Copyright (C) 2017-2020 Johannes Pohl

# This software may be modified and distributed under the terms
# of the MIT license. See the LICENSE file for details.


cmake_minimum_required(VERSION 3.0.0)

project(jsonrpcpp VERSION 1.3.1 LANGUAGES CXX)
project(jsonrpcpp VERSION 1.3.2 LANGUAGES CXX)
set(PROJECT_DESCRIPTION "C++ JSON-RPC 2.0 library")
set(PROJECT_URL "https://github.com/badaix/jsonrpcpp")

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2019 Johannes Pohl
Copyright (c) 2017-2020 Johannes Pohl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ CXXFLAGS = -std=c++11 -Wall -O3 -Iinclude -pedantic -Wextra -Wshadow -Wconversi

OBJ = example/jsonrpcpp_example.o

reformat:
clang-format -i include/jsonrpcpp.hpp
clang-format -i example/jsonrpcpp_example.cpp
clang-format -i test/test_main.cpp

all: $(OBJ)
$(CXX) $(CXXFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS)
Expand Down
2 changes: 1 addition & 1 deletion example/jsonrpcpp_example.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***
This file is part of jsonrpc++
Copyright (C) 2017-2019 Johannes Pohl
Copyright (C) 2017-2020 Johannes Pohl
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.
Expand Down
21 changes: 6 additions & 15 deletions include/jsonrpcpp.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
_( )/ ___) / \ ( ( \( _ \( _ \ / __)( ) ( )
/ \) \\___ \( O )/ / ) / ) __/( (__(_ _)(_ _)
\____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_)
version 1.3.1
version 1.3.2
https://github.com/badaix/jsonrpcpp
This file is part of jsonrpc++
Copyright (C) 2017-2019 Johannes Pohl
Copyright (C) 2017-2020 Johannes Pohl
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.
Expand Down Expand Up @@ -630,7 +630,7 @@ inline Id::Id(const std::string& id) : Id(id.c_str())
{
}

inline Id::Id(const Json& json_id) : Entity(entity_t::id), type_(value_t::null)
inline Id::Id(const Json& json_id) : Id()
{
Id::parse_json(json_id);
}
Expand Down Expand Up @@ -802,10 +802,7 @@ inline void Error::parse_json(const Json& json)

inline Json Error::to_json() const
{
Json j = {
{"code", code_},
{"message", message_},
};
Json j = {{"code", code_}, {"message", message_}};

if (!data_.is_null())
j["data"] = data_;
Expand Down Expand Up @@ -1065,10 +1062,7 @@ inline void Response::parse_json(const Json& json)

inline Json Response::to_json() const
{
Json j = {
{"jsonrpc", "2.0"},
{"id", id_.to_json()},
};
Json j = {{"jsonrpc", "2.0"}, {"id", id_.to_json()}};

if (error_)
j["error"] = error_.to_json();
Expand Down Expand Up @@ -1130,10 +1124,7 @@ inline void Notification::parse_json(const Json& json)

inline Json Notification::to_json() const
{
Json json = {
{"jsonrpc", "2.0"},
{"method", method_},
};
Json json = {{"jsonrpc", "2.0"}, {"method", method_}};

if (params_)
json["params"] = params_.to_json();
Expand Down
2 changes: 1 addition & 1 deletion test/test_main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/***
This file is part of jsonrpc++
Copyright (C) 2017-2019 Johannes Pohl
Copyright (C) 2017-2020 Johannes Pohl
This software may be modified and distributed under the terms
of the MIT license. See the LICENSE file for details.
Expand Down

0 comments on commit 0111fab

Please sign in to comment.