[syslinux:master] hdt: Using Macro to create objects

syslinux-bot for Erwan Velu erwanaliasr1 at gmail.com
Mon Apr 25 15:28:36 PDT 2011


Commit-ID:  96a9bd115f5473594d06d142131eae54d43bbee4
Gitweb:     http://syslinux.zytor.com/commit/96a9bd115f5473594d06d142131eae54d43bbee4
Author:     Erwan Velu <erwanaliasr1 at gmail.com>
AuthorDate: Thu, 31 Mar 2011 21:51:35 +0200
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Thu, 31 Mar 2011 21:51:35 +0200

hdt: Using Macro to create objects

It makes the code easier to read


---
 com32/hdt/hdt-dump-vesa.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/com32/hdt/hdt-dump-vesa.c b/com32/hdt/hdt-dump-vesa.c
index 3818435..ddf096f 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);



More information about the Syslinux-commits mailing list