Denis Oliver Kropp wrote:
> DirectResult
> fusion_object_set_property( FusionObject  *object,
>                             const char    *key,
>                             void          *value,
>                             void         **old_value )
> {
>      DirectResult  ret;
>      char         *sharedkey;
> 
>      D_MAGIC_ASSERT( object, FusionObject );
>      D_ASSERT( object->shared != NULL );
>      D_ASSERT( key != NULL );
>      D_ASSERT( value != NULL );
> 
>      /* Create property hash on demand. */
>      if (!object->properties) {
>           ret = fusion_hash_create( object->shared->main_pool,
>                                     HASH_STRING, HASH_PTR,
>                                     FUSION_HASH_MIN_SIZE,
>                                     &object->properties );
>           if (ret)
>                return ret;
>      }
> 
>      /* Create a shared copy of the key. */
>      sharedkey = SHSTRDUP( object->shared->main_pool, key );
>      if (!sharedkey)
>           return D_OOSHM();
> 
>      /* Put it into the hash. */
>      return fusion_hash_replace( object->properties, sharedkey,
>                                  value, NULL, old_value );
> }
> 
> 
> Consistent indent and spacing, assertions where possible,
> some empty lines to separate code blocks... :-)
> 
> Maybe I'm a bit too perfectionist...
> 

...not enough, now it should be fine:

      [...]

      /* Put it into the hash. */
      ret = fusion_hash_replace( object->properties, sharedkey,
                                 value, NULL, old_value );
      if (ret)
           SHFREE( sharedkey );

      return ret;
}



There are also problems in other functions, like missing return values etc.

I'm finalizing the new code now, but please do the finalization before
the checkin next time. You'll never know if you get a chance to do that
afterwards :-)

At least for the core libraries we should keep the code in a decent shape.

-- 
Best regards,
   Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to