Author Topic: no used local typedef  (Read 5527 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
no used local typedef
« on: June 01, 2013, 08:36:11 am »
Code
BreakpointsDlg::BreakpointsDlg() :
    wxPanel(Manager::Get()->GetAppWindow(), -1),
    m_icons(16, 16, true)
{
    wxBoxSizer* bs = new wxBoxSizer(wxVERTICAL);
    m_pList = new wxListCtrl(this, idList, wxDefaultPosition, wxDefaultSize,
                             wxLC_REPORT | wxLC_HRULES | wxLC_VRULES);
    bs->Add(m_pList, 1, wxEXPAND | wxALL);
    SetAutoLayout(TRUE);
    SetSizer(bs);

    // Setup the image list for the enabled/disabled icons.
    const wxString &basepath = ConfigManager::GetDataFolder() + wxT("/manager_resources.zip#zip:/images/16x16/");
    wxBitmap icon = cbLoadBitmap(basepath + wxT("breakpoint.png"), wxBITMAP_TYPE_PNG);
    if (icon.IsOk())
        m_icons.Add(icon);
    icon = cbLoadBitmap(basepath + wxT("breakpoint_disabled.png"), wxBITMAP_TYPE_PNG);
    if (icon.IsOk())
        m_icons.Add(icon);
    icon = cbLoadBitmap(basepath + wxT("breakpoint_other.png"), wxBITMAP_TYPE_PNG);
    if (icon.IsOk())
        m_icons.Add(icon);
    m_pList->SetImageList(&m_icons, wxIMAGE_LIST_SMALL);

    m_pList->InsertColumn(Type, _("Type"), wxLIST_FORMAT_LEFT, 128);
    m_pList->InsertColumn(FilenameAddress, _("Filename/Address"), wxLIST_FORMAT_LEFT, 128);
    m_pList->InsertColumn(Line, _("Line"), wxLIST_FORMAT_LEFT, 44);
    m_pList->InsertColumn(Info, _("Info"), wxLIST_FORMAT_LEFT, 120);
    m_pList->InsertColumn(Debugger, _("Debugger"), wxLIST_FORMAT_LEFT, 60);

    Connect(idList, -1, wxEVT_COMMAND_LIST_ITEM_ACTIVATED,
            (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction)
            &BreakpointsDlg::OnDoubleClick);

    Connect(idList, -1, wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK,
            (wxObjectEventFunction) (wxEventFunction) (wxListEventFunction)
            &BreakpointsDlg::OnRightClick);

    typedef cbEventFunctor<BreakpointsDlg, CodeBlocksEvent> CBEvent;

    Reload();
}
See:
Code
 typedef cbEventFunctor<BreakpointsDlg, CodeBlocksEvent> CBEvent; 


Not used, right?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: no used local typedef
« Reply #1 on: June 01, 2013, 09:48:27 am »
Yes, you can remove it.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: no used local typedef
« Reply #2 on: June 03, 2013, 11:35:55 am »
Done in r9133.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.