couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kxe...@apache.org
Subject couchdb-b64url git commit: Fix "dereferencing type-punned pointer will break strict-aliasing" warn
Date Thu, 16 Jul 2015 16:28:22 GMT
Repository: couchdb-b64url
Updated Branches:
  refs/heads/master d9c132068 -> 30a50f268


Fix "dereferencing type-punned pointer will break strict-aliasing" warn

Thanks @davisp for help with the patch.

COUCHDB-2588


Project: http://git-wip-us.apache.org/repos/asf/couchdb-b64url/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-b64url/commit/30a50f26
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-b64url/tree/30a50f26
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-b64url/diff/30a50f26

Branch: refs/heads/master
Commit: 30a50f268ffce680e523d5ac3ee6b60db25d4347
Parents: d9c1320
Author: Alexander Shorin <kxepal@apache.org>
Authored: Wed Jul 15 23:53:43 2015 +0300
Committer: Alexander Shorin <kxepal@apache.org>
Committed: Wed Jul 15 23:53:43 2015 +0300

----------------------------------------------------------------------
 c_src/b64url.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-b64url/blob/30a50f26/c_src/b64url.c
----------------------------------------------------------------------
diff --git a/c_src/b64url.c b/c_src/b64url.c
index 842d82e..074d9a0 100644
--- a/c_src/b64url.c
+++ b/c_src/b64url.c
@@ -411,6 +411,7 @@ b64url_encode_cont(ErlNifEnv* env, int argc, const ENTERM argv[])
     ErlNifBinary src;
     b64url_priv* priv = (b64url_priv*) enif_priv_data(env);
     b64url_st* st = NULL;
+    void* res = NULL;
     int status;
 
     if(argc != 2) {
@@ -421,10 +422,12 @@ b64url_encode_cont(ErlNifEnv* env, int argc, const ENTERM argv[])
         return enif_make_badarg(env);
     }
 
-    if(!enif_get_resource(env, argv[1], priv->res_st, (void**) &st)) {
+    if(!enif_get_resource(env, argv[1], priv->res_st, &res)) {
         return enif_make_badarg(env);
     }
 
+    st = (b64url_st*) res;
+
     if(!check_pid(env, st)) {
         return enif_make_badarg(env);
     }
@@ -565,6 +568,7 @@ b64url_decode_cont(ErlNifEnv* env, int argc, const ENTERM argv[])
     ErlNifBinary src;
     b64url_priv* priv = (b64url_priv*) enif_priv_data(env);
     b64url_st* st = NULL;
+    void* res = NULL;
     ENTERM ret = priv->atom_error;
     int status;
 
@@ -576,10 +580,12 @@ b64url_decode_cont(ErlNifEnv* env, int argc, const ENTERM argv[])
         return enif_make_badarg(env);
     }
 
-    if(!enif_get_resource(env, argv[1], priv->res_st, (void**) &st)) {
+    if(!enif_get_resource(env, argv[1], priv->res_st, &res)) {
         return enif_make_badarg(env);
     }
 
+    st = (b64url_st*) res;
+
     if(!check_pid(env, st)) {
         return enif_make_badarg(env);
     }


Mime
View raw message