Branch: Tag:

2013-10-20

2013-10-20 13:59:27 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Nettle: Use ASSIGN_CURRENT_STORAGE() in the hashes.

16:       INIT    { -  struct Hash_struct *Hash = (struct Hash_struct *) -  get_inherit_storage(Pike_fp->current_object, -  1 + -  (Pike_fp->context - -  Pike_fp->current_program->inherits)); +  struct Hash_struct *hash; +  ASSIGN_CURRENT_STORAGE(hash, struct Hash_struct, 1, Hash_program);       werror(cmod_STRFY_EVAL(PIKE_NAME) "->INIT\n");    -  if (Hash && !Hash->meta) -  Hash->meta = &cmod_CONCAT_EVAL(nettle_, NETTLE_NAME); -  else { -  /* Can't call Pike_error here. -  * Pike_error("Can't initialize this object.\n"); */ -  werror(cmod_STRFY_EVAL(PIKE_NAME) "->INIT failed\n"); +  hash->meta = &cmod_CONCAT_EVAL(nettle_, NETTLE_NAME);    } -  } +        DOCSTART() @class State    *!
71:       INIT    { -  /* FIXME: Ought to traverse the inherit graph for -  * the current program. -  */ -  struct Hash_State_struct *instance = (struct Hash_State_struct *) -  get_inherit_storage(Pike_fp->current_object, -  1 + -  (Pike_fp->context - -  Pike_fp->current_program->inherits)); +  struct Hash_State_struct *instance; +  ASSIGN_CURRENT_STORAGE(instance, struct Hash_State_struct, 1, +  Hash_State_program); +     werror(cmod_STRFY_EVAL(PIKE_NAME) ".State->INIT\n");    -  assert(instance); -  +     cmod_CONCAT_EVAL(NETTLE_NAME, _init)(&THIS->NETTLE_NAME);    instance->ctx = &THIS->NETTLE_NAME;    }