Просмотр исходного кода

Bug 455489 - Address compiler warnings about strict-aliasing rules

https://bugzilla.redhat.com/show_bug.cgi?id=455489
Resolves: bug 455489
Bug description: Address compiler warnings about strict-aliasing rules
Fix description: The codes that generate strict-aliasing warnings have
been changed.
Reviewed by: rmeggins (and pushed by)
Endi S. Dewata 15 лет назад
Родитель
Сommit
65e04b8d72
2 измененных файлов с 5 добавлено и 3 удалено
  1. 3 1
      ldap/servers/plugins/replication/cl5_api.c
  2. 2 2
      ldap/servers/slapd/libglobs.c

+ 3 - 1
ldap/servers/plugins/replication/cl5_api.c

@@ -4548,6 +4548,7 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge)
 	char csnStr [CSN_STRSIZE];
 	struct berval **vals;
 	DB_TXN *txnid = NULL;
+	char *buff;
 
 	if ((purge && file->purgeRUV == NULL) || (!purge && file->maxRUV == NULL))
 		return CL5_SUCCESS;
@@ -4565,7 +4566,8 @@ static int _cl5WriteRUV (CL5DBFile *file, PRBool purge)
 
 	key.size = CSN_STRSIZE;
     
-	rc = _cl5WriteBervals (vals, (char**)&data.data, &data.size);
+	rc = _cl5WriteBervals (vals, &buff, &data.size);
+	data.data = buff;
 	ber_bvecfree(vals);
 	if (rc != CL5_SUCCESS)
 	{

+ 2 - 2
ldap/servers/slapd/libglobs.c

@@ -5796,9 +5796,9 @@ config_set_entry(Slapi_Entry *e)
 
         if (needs_free && value) { /* assumes memory allocated by slapi_ch_Xalloc */
             if (CONFIG_CHARRAY == cgas->config_var_type) {
-                charray_free(*((char ***)value));
+                charray_free((char **)*value);
             } else if (CONFIG_SPECIAL_REFERRALLIST == cgas->config_var_type) {
-                ber_bvecfree(*((struct berval ***)value));
+                ber_bvecfree((struct berval **)*value);
             } else if ((CONFIG_CONSTANT_INT != cgas->config_var_type) && /* do not free constants */
                        (CONFIG_CONSTANT_STRING != cgas->config_var_type)) {
                 slapi_ch_free(value);