static int self_construct(songdata *songdata) { songdata->mdx2151 = _mdx2151_initialize(); if (!songdata->mdx2151) { goto error_end; } songdata->mdxmml_ym2151 = _mdxmml_ym2151_initialize(); if (!songdata->mdxmml_ym2151) { goto error_end; } songdata->pcm8 = _pcm8_initialize(); if (!songdata->pcm8) { goto error_end; } #if 0 self_ym2151_c = _ym2151_c_initialize(); if (!self_ym2151_c) { goto error_end; } #endif return FLAG_TRUE; error_end: #if 0 if (self_ym2151_c) { _ym2151_c_finalize(self_ym2151_c); self_ym2151_c = NULL; } #endif if (songdata->pcm8) { _pcm8_finalize(songdata->pcm8); songdata->pcm8 = NULL; } if (songdata->mdxmml_ym2151) { _mdxmml_ym2151_finalize(songdata->mdxmml_ym2151); songdata->mdxmml_ym2151 = NULL; } if (songdata->mdx2151) { _mdx2151_finalize(songdata->mdx2151); songdata->mdx2151 = NULL; } return FLAG_FALSE; }
static void self_destroy(songdata *songdata) { #if 0 if (self_ym2151_c) { _ym2151_c_finalize(self_ym2151_c); self_ym2151_c = NULL; } #endif if (songdata->pcm8) { _pcm8_finalize(songdata->pcm8); songdata->pcm8 = NULL; } if (songdata->mdxmml_ym2151) { _mdxmml_ym2151_finalize(songdata->mdxmml_ym2151); songdata->mdxmml_ym2151 = NULL; } if (songdata->mdx2151) { _mdx2151_finalize(songdata->mdx2151); songdata->mdx2151 = NULL; } }
static void self_destroy(void) { #if 0 if (self_ym2151_c) { _ym2151_c_finalize(self_ym2151_c); self_ym2151_c = NULL; } #endif if (self_pcm8) { _pcm8_finalize(self_pcm8); self_pcm8 = NULL; } if (self_mdxmml_ym2151) { _mdxmml_ym2151_finalize(self_mdxmml_ym2151); self_mdxmml_ym2151 = NULL; } if (self_mdx2151) { _mdx2151_finalize(self_mdx2151); self_mdx2151 = NULL; } }