Skip to content

Commit

Permalink
fixing linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AsherGlick committed Nov 4, 2023
1 parent 29de4fb commit 695fc35
Show file tree
Hide file tree
Showing 23 changed files with 27 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
{% if type == "Enum" %}
Expand Down
3 changes: 1 addition & 2 deletions xml_converter/src/attribute/bool.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand All @@ -16,7 +16,6 @@ void xml_attribute_to_bool(

std::string bool_to_xml_attribute(const std::string& attribute_name, const bool* value);


// Zero Cost Abstraction identity functions to make parsing and writing protobufs more uniform
inline bool const& from_proto_bool(const bool& x) {
return x;
Expand Down
14 changes: 6 additions & 8 deletions xml_converter/src/attribute/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ string color_to_xml_attribute(const string& attribute_name, const Color* value)
return " " + attribute_name + "=\"" + rgb + "\"";
}


////////////////////////////////////////////////////////////////////////////////
// from_proto_color
//
Expand All @@ -132,7 +131,6 @@ Color from_proto_color(waypoint::RGBAColor attribute_value) {
return color;
}


////////////////////////////////////////////////////////////////////////////////
// color_to_proto
//
Expand All @@ -148,12 +146,12 @@ void color_to_proto(Color value, std::function<void(waypoint::RGBAColor*)> sette
int_alpha = convert_color_channel_float_to_int(value.alpha);
}

uint32_t rgba =
((convert_color_channel_float_to_int(value.red) & 0xff) << 24)
+ ((convert_color_channel_float_to_int(value.green) & 0xff) << 16)
+ ((convert_color_channel_float_to_int(value.blue) & 0xff) << 8)
+ (int_alpha & 0xff);
uint32_t r = ((convert_color_channel_float_to_int(value.red) & 0xff) << 24);
uint32_t g = ((convert_color_channel_float_to_int(value.green) & 0xff) << 16);
uint32_t b = ((convert_color_channel_float_to_int(value.blue) & 0xff) << 8);
uint32_t a = (int_alpha & 0xff);
uint32_t rgba = r | g | b | a;

color->set_rgba_color(rgba);
setter(color);
}
}
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/color.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/cull_chirality_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
#include "waypoint.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/euler_rotation_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/festival_filter_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/float.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/image.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down
3 changes: 1 addition & 2 deletions xml_converter/src/attribute/int.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand All @@ -22,4 +22,3 @@ inline int const& from_proto_int(const int& x) {
}

void int_to_proto(int value, std::function<void(int&)> setter);

2 changes: 1 addition & 1 deletion xml_converter/src/attribute/map_type_filter_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/marker_category.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ void marker_category_to_proto(MarkerCategory value, std::function<void(waypoint:
waypoint::Category* category = new waypoint::Category();
category->set_name(value.category);
setter(category);
}
}
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/marker_category.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/mount_filter_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/position_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/profession_filter_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/reset_behavior_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
#include "waypoint.pb.h"
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/specialization_filter_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/species_filter_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"
class XMLError;
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/string.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/trail_data.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#pragma once

#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down
1 change: 0 additions & 1 deletion xml_converter/src/attribute/unique_id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ string unique_id_to_xml_attribute(const string& attribute_name, const UniqueId*
return " " + attribute_name + "=\"" + base64_encode(&(value->guid[0]), value->guid.size()) + "\"";
}


UniqueId from_proto_unique_id(string attribute_value) {
UniqueId unique_id;
std::vector<uint8_t> guid(attribute_value.begin(), attribute_value.end());
Expand Down
2 changes: 1 addition & 1 deletion xml_converter/src/attribute/unique_id.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include <cstdint>
#include <functional>
#include <string>
#include <vector>
#include <functional>

#include "../rapidxml-1.13/rapidxml.hpp"

Expand Down

0 comments on commit 695fc35

Please sign in to comment.