mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2024-12-24 20:01:42 +00:00
using freep and removing redundant code
This commit is contained in:
parent
95e2f7665b
commit
08996a3253
@ -1,6 +1,7 @@
|
||||
#include "ccextractor.h"
|
||||
#include "608_spupng.h"
|
||||
#include "cc_decoders_common.h"
|
||||
#include "utility.h"
|
||||
|
||||
static const int rowdata[] = {11,-1,1,2,3,4,12,13,14,15,5,6,7,8,9,10};
|
||||
// Relationship between the first PAC byte and the row number
|
||||
@ -585,11 +586,8 @@ int write_cc_buffer(struct s_context_cc608 *context)
|
||||
if (ccx_options.gui_mode_reports)
|
||||
write_cc_buffer_to_gui(data, context);
|
||||
data = (struct eia608_screen*)sub->data + 1;
|
||||
if (sub->data && !sub->size)
|
||||
{
|
||||
free(sub->data);
|
||||
sub->data = NULL;
|
||||
}
|
||||
if (!sub->size)
|
||||
freep(&sub->data);
|
||||
}
|
||||
|
||||
return wrote_something;
|
||||
|
@ -188,15 +188,6 @@ static __inline unsigned int get_bits1(GetBitContext *s)
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static void freep(void *arg)
|
||||
{
|
||||
void **ptr = (void **) arg;
|
||||
if (*ptr)
|
||||
free(*ptr);
|
||||
*ptr = NULL;
|
||||
|
||||
}
|
||||
#ifdef DEBUG
|
||||
|
||||
struct transIntensity
|
||||
|
@ -336,3 +336,12 @@ int string_cmp(const void *p1,const void *p2)
|
||||
{
|
||||
return string_cmp2(p1, p2, NULL);
|
||||
}
|
||||
|
||||
void freep(void *arg)
|
||||
{
|
||||
void **ptr = (void **) arg;
|
||||
if (*ptr)
|
||||
free(*ptr);
|
||||
*ptr = NULL;
|
||||
|
||||
}
|
||||
|
@ -13,5 +13,6 @@
|
||||
void shell_sort(void *base, int nb,size_t size,int (*compar)(const void*p1,const void *p2,void*arg),void *arg);
|
||||
int string_cmp(const void *p1,const void *p2);
|
||||
int string_cmp2(const void *p1,const void *p2,void *arg);
|
||||
void freep(void *arg);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user