Wireshark-commits: [Wireshark-commits] master 1c0d066: sharkd: cleanup printf() usage during JSON g

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Mon, 24 Sep 2018 19:39:05 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=1c0d066e10353d48c2fd9f965b160eeedbea511e
Submitter: "Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

1c0d066 by Jakub Zawadzki (darkjames-ws@xxxxxxxxxxxx):

    sharkd: cleanup printf() usage during JSON generation (part II).
    
    Lot of printf()s in sharkd are caused from:
     - opening array with a key, like: printf(",\"eo\":[");
     - opening object with comma separator, like: printf("%s{", i ? "," : "");
    
    Add argument to sharkd_json_{array,object}_open() to specify if there need to be a separator,
    and key argument to sharkd_json_array_open().
    
    Replace printf() with these functions.
    
    This change lower number of printf() from 365 to 300 (17% reduction).
    
    Change-Id: Id84259ae0fed47d9d7d84709e554a03c97d6ed98
    Reviewed-on: https://code.wireshark.org/review/29811
    Petri-Dish: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
    

Actions performed:

    from  2b9bc5e   RPM: Make the (optional) maxminddb dependencies actually work.
     add  1c0d066   sharkd: cleanup printf() usage during JSON generation (part II).


Summary of changes:
 sharkd_session.c | 243 ++++++++++++++++++++++++++++---------------------------
 1 file changed, 123 insertions(+), 120 deletions(-)