Skip to content

Commit 0111fab

Browse files
committed
Fix compiler warning
Raise verion to 1.3.2 Add reformat make target
1 parent ea6e081 commit 0111fab

File tree

6 files changed

+15
-20
lines changed

6 files changed

+15
-20
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
# \____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_)
55

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

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

1212

1313
cmake_minimum_required(VERSION 3.0.0)
1414

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

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2019 Johannes Pohl
3+
Copyright (c) 2017-2020 Johannes Pohl
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ CXXFLAGS = -std=c++11 -Wall -O3 -Iinclude -pedantic -Wextra -Wshadow -Wconversi
66

77
OBJ = example/jsonrpcpp_example.o
88

9+
reformat:
10+
clang-format -i include/jsonrpcpp.hpp
11+
clang-format -i example/jsonrpcpp_example.cpp
12+
clang-format -i test/test_main.cpp
913

1014
all: $(OBJ)
1115
$(CXX) $(CXXFLAGS) -o $(BIN) $(OBJ) $(LDFLAGS)

example/jsonrpcpp_example.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***
22
This file is part of jsonrpc++
3-
Copyright (C) 2017-2019 Johannes Pohl
3+
Copyright (C) 2017-2020 Johannes Pohl
44
55
This software may be modified and distributed under the terms
66
of the MIT license. See the LICENSE file for details.

include/jsonrpcpp.hpp

+6-15
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
_( )/ ___) / \ ( ( \( _ \( _ \ / __)( ) ( )
44
/ \) \\___ \( O )/ / ) / ) __/( (__(_ _)(_ _)
55
\____/(____/ \__/ \_)__)(__\_)(__) \___)(_) (_)
6-
version 1.3.1
6+
version 1.3.2
77
https://github.com/badaix/jsonrpcpp
88
99
This file is part of jsonrpc++
10-
Copyright (C) 2017-2019 Johannes Pohl
10+
Copyright (C) 2017-2020 Johannes Pohl
1111
1212
This software may be modified and distributed under the terms
1313
of the MIT license. See the LICENSE file for details.
@@ -630,7 +630,7 @@ inline Id::Id(const std::string& id) : Id(id.c_str())
630630
{
631631
}
632632

633-
inline Id::Id(const Json& json_id) : Entity(entity_t::id), type_(value_t::null)
633+
inline Id::Id(const Json& json_id) : Id()
634634
{
635635
Id::parse_json(json_id);
636636
}
@@ -802,10 +802,7 @@ inline void Error::parse_json(const Json& json)
802802

803803
inline Json Error::to_json() const
804804
{
805-
Json j = {
806-
{"code", code_},
807-
{"message", message_},
808-
};
805+
Json j = {{"code", code_}, {"message", message_}};
809806

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

10661063
inline Json Response::to_json() const
10671064
{
1068-
Json j = {
1069-
{"jsonrpc", "2.0"},
1070-
{"id", id_.to_json()},
1071-
};
1065+
Json j = {{"jsonrpc", "2.0"}, {"id", id_.to_json()}};
10721066

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

11311125
inline Json Notification::to_json() const
11321126
{
1133-
Json json = {
1134-
{"jsonrpc", "2.0"},
1135-
{"method", method_},
1136-
};
1127+
Json json = {{"jsonrpc", "2.0"}, {"method", method_}};
11371128

11381129
if (params_)
11391130
json["params"] = params_.to_json();

test/test_main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/***
22
This file is part of jsonrpc++
3-
Copyright (C) 2017-2019 Johannes Pohl
3+
Copyright (C) 2017-2020 Johannes Pohl
44
55
This software may be modified and distributed under the terms
66
of the MIT license. See the LICENSE file for details.

0 commit comments

Comments
 (0)