Skip to content

_Itype_for_any(T) parameter itype duplicated #216

Open
@mwhicks1

Description

@mwhicks1
typedef unsigned long size_t;

extern void *memset(void * dest : byte_count(n),
             int c,
             size_t n) : bounds(dest, (_Array_ptr<char>)dest + n);

_Itype_for_any(T) void
vsf_sysutil_memclr(void* p_dest : itype(_Array_ptr<T>) byte_count(size), unsigned int size)
{
  memset(p_dest, '\0', size);
}

rewrites to

typedef unsigned long size_t;

extern void *memset(void * dest : byte_count(n),
             int c,
             size_t n) : bounds(dest, (_Array_ptr<char>)dest + n);

void vsf_sysutil_memclr(T * p_dest : itype(_Array_ptr<T>) : byte_count(size), unsigned int size)
{
  memset(p_dest, '\0', size);
}

Two problems:

  • The _Itype_for_any(T) part got dropped.
  • The type of p_dest was changed from void * to T *

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions