Changeset 0c4ef53


Ignore:
Timestamp:
Sep 28, 2009, 1:14:23 PM (11 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
e60f98c
Parents:
eddee7e
git-author:
Anders Kaseorg <andersk@mit.edu> (09/27/09 19:31:17)
git-committer:
Anders Kaseorg <andersk@mit.edu> (09/28/09 13:14:23)
Message:
Simplify calls to SvREFCNT_inc by using its return value.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlglue.xs

    r4df918b r0c4ef53  
    174174                owl_function_start_question(line);
    175175
    176                 SvREFCNT_inc(callback);
    177                 owl_editwin_set_cbdata(owl_global_get_typwin(&g), callback);
     176                owl_editwin_set_cbdata(owl_global_get_typwin(&g), SvREFCNT_inc(callback));
    178177                owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
    179178        }
     
    190189                owl_function_start_password(line);
    191190
    192                 SvREFCNT_inc(callback);
    193                 owl_editwin_set_cbdata(owl_global_get_typwin(&g), callback);
     191                owl_editwin_set_cbdata(owl_global_get_typwin(&g), SvREFCNT_inc(callback));
    194192                owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
    195193        }
     
    216214                owl_global_set_typwin_active(&g);
    217215
    218                 SvREFCNT_inc(callback);
    219                 owl_editwin_set_cbdata(owl_global_get_typwin(&g), callback);
     216                owl_editwin_set_cbdata(owl_global_get_typwin(&g), SvREFCNT_inc(callback));
    220217                owl_editwin_set_callback(owl_global_get_typwin(&g), owl_perlconfig_edit_callback);
    221218        }
     
    331328        SV * cb
    332329        CODE:
    333         SvREFCNT_inc(cb);
    334         owl_select_add_perl_dispatch(fd, cb);
     330        owl_select_add_perl_dispatch(fd, SvREFCNT_inc(cb));
    335331
    336332void
     
    437433                        croak("Command function must be a coderef!");
    438434                }
    439                 SvREFCNT_inc(func);
    440435                cmd.name = name;
    441                 cmd.cmd_perl = func;
     436                cmd.cmd_perl = SvREFCNT_inc(func);
    442437                cmd.summary = summary;
    443438                cmd.usage = usage;
Note: See TracChangeset for help on using the changeset viewer.