Wireshark-dev: [Wireshark-dev] packet_win.c still broken

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Tue, 25 Jun 2013 21:27:31 +0200
Hello Guy,

your change to the buffer handling broke packet_win.c when being built
with WANT_PACKET_EDITOR.
As I asked about this problem before, maybe this bug isn't worth fixing,
but then we should remove WANT_PACKET_EDITOR.

 Ciao
      Jörg

[ 82%] Building C object ui/gtk/CMakeFiles/gtkui.dir/packet_win.c.o
In file included from /home/jmayer/work/wireshark/svn/trunk/wiretap/wtap.h:32:0,
                 from /home/jmayer/work/wireshark/svn/trunk/epan/nstime.h:30,
                 from /home/jmayer/work/wireshark/svn/trunk/epan/frame_data.h:30,
                 from /home/jmayer/work/wireshark/svn/trunk/epan/epan.h:32,
                 from /home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:44:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c: In function ‘finfo_window_refresh’:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:251:35: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
   data = buffer_start_ptr(&DataPtr->buf) + DataPtr->start_offset + old_finfo->start;
                                   ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:37: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:251:35: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
   data = buffer_start_ptr(&DataPtr->buf) + DataPtr->start_offset + old_finfo->start;
                                   ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:54: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                                      ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:261:35: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
   data = buffer_start_ptr(&DataPtr->buf) + DataPtr->start_offset + old_finfo->appendix_start;
                                   ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:37: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:261:35: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
   data = buffer_start_ptr(&DataPtr->buf) + DataPtr->start_offset + old_finfo->appendix_start;
                                   ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:54: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                                      ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:271:66: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  epan_dissect_run(&edt, &DataPtr->phdr, buffer_start_ptr(&DataPtr->buf), DataPtr->frame, NULL);
                                                                  ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:37: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:271:66: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  epan_dissect_run(&edt, &DataPtr->phdr, buffer_start_ptr(&DataPtr->buf), DataPtr->frame, NULL);
                                                                  ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:54: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                                      ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c: In function ‘finfo_integer_common’:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:298:40: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  guint8 *pd = buffer_start_ptr(&DataPtr->buf);
                                        ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:37: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:298:40: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  guint8 *pd = buffer_start_ptr(&DataPtr->buf);
                                        ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:54: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                                      ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c: In function ‘finfo_string_changed’:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:342:40: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  guint8 *pd = buffer_start_ptr(&DataPtr->buf);
                                        ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:37: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:342:40: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  guint8 *pd = buffer_start_ptr(&DataPtr->buf);
                                        ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:54: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                                      ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c: In function ‘finfo_bv_key_pressed_cb’:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:433:37: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  data.pd = buffer_start_ptr(&DataPtr->buf);
                                     ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:37: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:433:37: error: ‘struct FieldinfoWinData’ has no member named ‘buf’
  data.pd = buffer_start_ptr(&DataPtr->buf);
                                     ^
/home/jmayer/work/wireshark/svn/trunk/wiretap/buffer.h:58:54: note: in definition of macro ‘buffer_start_ptr’
 # define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
                                                      ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c: In function ‘edit_pkt_common_key_pressed_cb’:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:771:72: error: invalid operands to binary & (have ‘Buffer’ and ‘int’)
     DataPtr->pd[DataPtr->pd_offset] = (DataPtr->pd[DataPtr->pd_offset] & 0x0f) | (val << 4);
                                                                        ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:774:72: error: invalid operands to binary & (have ‘Buffer’ and ‘int’)
     DataPtr->pd[DataPtr->pd_offset] = (DataPtr->pd[DataPtr->pd_offset] & 0xf0) | val;
                                                                        ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:793:37: error: invalid operands to binary | (have ‘Buffer’ and ‘int’)
     DataPtr->pd[DataPtr->pd_offset] |= (1 << (7-DataPtr->pd_bitoffset));
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:795:37: error: invalid operands to binary & (have ‘Buffer’ and ‘int’)
     DataPtr->pd[DataPtr->pd_offset] &= ~(1 << (7-DataPtr->pd_bitoffset));
                                     ^
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c: In function ‘edit_pkt_win_key_pressed_cb’:
/home/jmayer/work/wireshark/svn/trunk/ui/gtk/packet_win.c:829:10: error: assignment from incompatible pointer type [-Werror]
  data.pd = buffer_start_ptr(&DataPtr->buf);
          ^
cc1: all warnings being treated as errors
make[2]: *** [ui/gtk/CMakeFiles/gtkui.dir/packet_win.c.o] Error 1
make[2]: Target `ui/gtk/CMakeFiles/gtkui.dir/build' not remade because of errors.
make[1]: *** [ui/gtk/CMakeFiles/gtkui.dir/all] Error 2

--
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.