Wireshark-commits: [Wireshark-commits] master 00373a1: Simplify the mode passed to CreateNamedPipe(

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 01 Mar 2018 04:05:13 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=00373a1fd4f4cd75a0fb2f2c21b7d9fd567a41b9
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

00373a1 by Guy Harris (guy@xxxxxxxxxxxx):

    Simplify the mode passed to CreateNamedPipe().
    
    There's one mode you use if byte_mode is true, and another mode you use
    if it's false.  My head hurts when I try to pretend to be a top-down
    parser for C and feed myself the existing expression, and Visual Studio
    Code Analyzer says "are you sure that's what you had in mind?", so I'm
    guessing the modes are:
    
    	byte mode: PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT
    	not byte mode: PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT
    
    and am just using one test of byte_mode to choose between them.
    
    Put the entire function under an #ifdef, so we can mark the byte_mode
    argument as unused on UN*X but not on Windows.
    
    Change-Id: Ib2d0b80f870b1789c1375ccb017bd90e93dca5ce
    Reviewed-on: https://code.wireshark.org/review/26201
    Petri-Dish: Guy Harris <guy@xxxxxxxxxxxx>
    Tested-by: Petri Dish Buildbot
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  efd8bef   Don't handle various "command to send" values in the default case.
    adds  00373a1   Simplify the mode passed to CreateNamedPipe().


Summary of changes:
 extcap.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)