dstep icon indicating copy to clipboard operation
dstep copied to clipboard

Problem with static inline?

Open russel opened this issue 7 years ago • 6 comments

It appears that the following in a C header file:

static inline void dvb_file_free(struct dvb_file *dvb_file)
{
	struct dvb_entry *entry = dvb_file->first_entry, *next;
	while (entry) {
		next = entry->next;
		if (entry->channel)
			free(entry->channel);
		if (entry->vchannel)
			free(entry->vchannel);
		if (entry->location)
			free(entry->location);
		if (entry->video_pid)
			free(entry->video_pid);
		if (entry->audio_pid)
			free(entry->audio_pid);
		if (entry->other_el_pid)
			free(entry->other_el_pid);
		if (entry->lnb)
			free(entry->lnb);
		free(entry);
		entry = next;
	}
	free(dvb_file);
}

results in the D module with:

void dvb_file_free (dvb_file* dvb_file);

which sadly has to be considered a bug.

russel avatar Jun 04 '17 15:06 russel

dstep doesn't translate function bodies at all.

ciechowoj avatar Jun 04 '17 15:06 ciechowoj

Yeah, that's a completely new topic.

jacob-carlborg avatar Jun 04 '17 15:06 jacob-carlborg

OK, I cut and paste into the function manually.

russel avatar Jun 04 '17 15:06 russel

I'm putting this as an enhancement request.

jacob-carlborg avatar Jun 04 '17 15:06 jacob-carlborg

@jacob-carlborg -- I don't necessarily need the fn body transplanted, even a diagnostic warning that this has happened would be excellent.

jblachly avatar Aug 13 '20 05:08 jblachly

I don't necessarily need the fn body transplanted, even a diagnostic warning that this has happened would be excellent.

That should be doable.

jacob-carlborg avatar Aug 13 '20 06:08 jacob-carlborg