Skip to content

Commit

Permalink
fix initialization warnings for clang's Wconditional-uninitialized
Browse files Browse the repository at this point in the history
  • Loading branch information
slact committed Oct 12, 2014
1 parent 443143e commit 142b637
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/ngx_http_push_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,13 +664,13 @@ ngx_int_t ngx_http_push_respond_to_subscribers(ngx_http_push_channel_t *channel,
//copy everything we need first
ngx_str_t *content_type=NULL;
ngx_str_t *etag=NULL;
time_t last_modified;
time_t last_modified = 0;
ngx_chain_t *chain=NULL;
ngx_http_request_t *r;
ngx_buf_t *buffer;
ngx_buf_t *buffer = NULL;
ngx_chain_t *rchain;
ngx_buf_t *rbuffer;
ngx_int_t *buf_use_count;
ngx_int_t *buf_use_count = NULL;
ngx_http_push_subscriber_cleanup_t *clndata;
ngx_http_push_subscriber_t *cur=NULL;
ngx_int_t responded_subscribers=0;
Expand Down
4 changes: 2 additions & 2 deletions src/store/memory/store.c
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ static ngx_int_t ngx_http_push_store_subscribe(ngx_str_t *channel_id, ngx_http_p
}

static ngx_str_t * ngx_http_push_store_etag_from_message(ngx_http_push_msg_t *msg, ngx_pool_t *pool){
ngx_str_t *etag;
ngx_str_t *etag = NULL;
ngx_shmtx_lock(&ngx_http_push_shpool->mutex);
if(pool!=NULL && (etag = ngx_palloc(pool, sizeof(*etag) + NGX_INT_T_LEN))==NULL) {
return NULL;
Expand All @@ -816,7 +816,7 @@ static ngx_str_t * ngx_http_push_store_etag_from_message(ngx_http_push_msg_t *ms
}

static ngx_str_t * ngx_http_push_store_content_type_from_message(ngx_http_push_msg_t *msg, ngx_pool_t *pool){
ngx_str_t *content_type;
ngx_str_t *content_type = NULL;
ngx_shmtx_lock(&ngx_http_push_shpool->mutex);
if(pool != NULL && (content_type = ngx_palloc(pool, sizeof(*content_type) + msg->content_type.len))==NULL) {
return NULL;
Expand Down
1 change: 1 addition & 0 deletions tests/nginx-pushmodule/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ build() {
if [[ $CC == *clang* ]]; then
#not a valid clang parameter
CFLAGS="${CFLAGS/-fvar-tracking-assignments/}"
CFLAGS="$CFLAGS -Wconditional-uninitialized"
elif [[ $CC == "cc" ]] || [[ $CC == "gcc" ]] || [[ -z $CC ]]; then
CFLAGS="-fdiagnostics-color=always $CFLAGS"
fi
Expand Down

0 comments on commit 142b637

Please sign in to comment.