Skip to content

Commit

Permalink
Fix gcc8 warning. (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn authored Jul 30, 2018
1 parent ecc57fd commit c01d8c4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
6 changes: 0 additions & 6 deletions opentracing/src/ngx_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
#include <cassert>

namespace ngx_opentracing {
//------------------------------------------------------------------------------
// NgxScript
//------------------------------------------------------------------------------
NgxScript::NgxScript() noexcept
: pattern_{0, nullptr}, lengths_{nullptr}, values_{nullptr} {}

//------------------------------------------------------------------------------
// compile
//------------------------------------------------------------------------------
Expand Down
7 changes: 1 addition & 6 deletions opentracing/src/ngx_script.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ extern "C" {
}

namespace ngx_opentracing {
class NgxScript {
public:
// Note: Constructor is compatible with begin zero initialized.
NgxScript() noexcept;

struct NgxScript {
bool is_valid() const noexcept { return pattern_.data; }

ngx_int_t compile(ngx_conf_t *cf, const ngx_str_t &pattern) noexcept;
ngx_str_t run(ngx_http_request_t *request) const noexcept;

private:
ngx_str_t pattern_;
ngx_array_t *lengths_;
ngx_array_t *values_;
Expand Down
4 changes: 2 additions & 2 deletions opentracing/src/opentracing_context.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "opentracing_context.h"
#include "utility.h"

#include <stdexcept>
#include <sstream>
#include <stdexcept>

extern "C" {
extern ngx_module_t ngx_http_opentracing_module;
Expand Down Expand Up @@ -215,7 +215,7 @@ ngx_str_t OpenTracingContext::lookup_span_context_value(
// get_binary_context
//------------------------------------------------------------------------------
ngx_str_t OpenTracingContext::get_binary_context() const {
const auto& span = active_span();
const auto &span = active_span();
std::ostringstream oss;
auto was_successful = span.tracer().Inject(span.context(), oss);
if (!was_successful) {
Expand Down
5 changes: 2 additions & 3 deletions opentracing/src/opentracing_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ static ngx_int_t expand_opentracing_context_variable(
static ngx_int_t expand_opentracing_binary_context_variable(
ngx_http_request_t* request, ngx_http_variable_value_t* variable_value,
uintptr_t data) noexcept try {

auto context = get_opentracing_context(request);
if (context == nullptr) {
throw std::runtime_error{"no OpenTracingContext attached to request"};
Expand All @@ -94,7 +93,6 @@ static ngx_int_t expand_opentracing_binary_context_variable(
return NGX_ERROR;
}


//------------------------------------------------------------------------------
// add_variables
//------------------------------------------------------------------------------
Expand All @@ -106,7 +104,8 @@ ngx_int_t add_variables(ngx_conf_t* cf) noexcept {
opentracing_context_var->get_handler = expand_opentracing_context_variable;
opentracing_context_var->data = 0;

auto opentracing_binary_context = to_ngx_str(opentracing_binary_context_variable_name);
auto opentracing_binary_context =
to_ngx_str(opentracing_binary_context_variable_name);
auto opentracing_binary_context_var = ngx_http_add_variable(
cf, &opentracing_binary_context, NGX_HTTP_VAR_NOCACHEABLE);
opentracing_binary_context_var->get_handler =
Expand Down

0 comments on commit c01d8c4

Please sign in to comment.