aboutsummaryrefslogtreecommitdiffstats
path: root/com32/hdt
diff options
context:
space:
mode:
authorErwan Velu <erwanaliasr1@gmail.com>2011-03-31 21:51:35 +0200
committerErwan Velu <erwanaliasr1@gmail.com>2011-03-31 21:51:35 +0200
commit96a9bd115f5473594d06d142131eae54d43bbee4 (patch)
tree1166b981bff644b7ea9b598823e9344ebe28b737 /com32/hdt
parentc004a00d508e79f24f22efff8dcb142942a279ce (diff)
downloadsyslinux-96a9bd115f5473594d06d142131eae54d43bbee4.tar.gz
syslinux-96a9bd115f5473594d06d142131eae54d43bbee4.tar.xz
syslinux-96a9bd115f5473594d06d142131eae54d43bbee4.zip
hdt: Using Macro to create objects
It makes the code easier to read
Diffstat (limited to 'com32/hdt')
-rw-r--r--com32/hdt/hdt-dump-vesa.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/com32/hdt/hdt-dump-vesa.c b/com32/hdt/hdt-dump-vesa.c
index 38184356..ddf096fa 100644
--- a/com32/hdt/hdt-dump-vesa.c
+++ b/com32/hdt/hdt-dump-vesa.c
@@ -32,7 +32,7 @@
void dump_vesa(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
- *item = zzjson_create_object(config, NULL); /* empty object */
+ CREATE_NEW_OBJECT;
add_hb(is_vesa_valid);
if (hardware->is_vesa_valid) {
char buffer[64]={0};
@@ -50,9 +50,8 @@ void dump_vesa(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item
struct vesa_mode_info *mi = &hardware->vesa.vmi[i].mi;
if ((mi->h_res == 0) || (mi->v_res == 0))
continue;
- zzjson_print(config, *item);
- zzjson_free(config, *item);
- *item = zzjson_create_object(config, NULL); /* empty object */
+ FLUSH_OBJECT;
+ CREATE_NEW_OBJECT;
memset(buffer,0,sizeof(buffer));
snprintf(buffer,sizeof(buffer),"0x%04x",hardware->vesa.vmi[i].mode + 0x200);
add_s("vesa.kernel_mode",buffer);