~ubuntu-branches/ubuntu/breezy/pysvn/breezy

« back to all changes in this revision

Viewing changes to Source/pysvn_arg_processing.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2005-09-08 05:13:33 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050908051333-qgsa2rksrb4az1h4
Tags: 1.3.0-1
Package from release tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
static const char *int_to_string( int n )
66
66
{
67
67
    static char number_string[20];
68
 
    char *buffer = int_to_string_inner( n, &number_string[0] );
 
68
    int_to_string_inner( n, &number_string[0] );
69
69
    return number_string;
70
70
}
71
71
 
82
82
        throw Py::TypeError( msg );
83
83
    }
84
84
 
85
 
    int i;
 
85
    Py::Tuple::size_type t_i;
86
86
    // place all the positional args in the checked args dict
87
 
    for( i=0; i<m_args.size(); i++ )
 
87
    for( t_i=0; t_i<m_args.size(); t_i++ )
88
88
    {
89
 
        m_checked_args[ m_arg_desc[i].m_arg_name ] = m_args[i];
 
89
        m_checked_args[ m_arg_desc[t_i].m_arg_name ] = m_args[t_i];
90
90
    }
91
91
 
92
92
    // look for args by name in the kws dict
93
 
    for( i=0; i<m_max_args; i++ )
 
93
    for( t_i=0; t_i<m_max_args; t_i++ )
94
94
    {
95
 
        const argument_description &arg_desc = m_arg_desc[i];
 
95
        const argument_description &arg_desc = m_arg_desc[t_i];
96
96
 
97
97
        // check for duplicate
98
98
        if( m_kws.hasKey( arg_desc.m_arg_name ) )
111
111
    }
112
112
 
113
113
    // check for names we dont known about
 
114
    Py::List::size_type l_i;
114
115
    Py::List names( m_kws.keys() );
115
 
    for( i=0; i< names.length(); i++ )
 
116
    for( l_i=0; l_i< names.length(); l_i++ )
116
117
    {
117
118
        bool found = false;
118
 
        Py::String py_name( names[i] );
 
119
        Py::String py_name( names[l_i] );
119
120
        std::string name( py_name );
120
121
 
121
 
        for( i=0; i<m_max_args; i++ )
 
122
        for( t_i=0; t_i<m_max_args; t_i++ )
122
123
        {
123
 
            if( name == m_arg_desc[i].m_arg_name )
 
124
            if( name == m_arg_desc[t_i].m_arg_name )
124
125
                {
125
126
                found = true;
126
127
                break;
138
139
    }
139
140
 
140
141
    // check for min args
141
 
    for( i=0; i<m_min_args; i++ )
 
142
    for( t_i=0; t_i<m_min_args; t_i++ )
142
143
    {
143
 
        const argument_description &arg_desc = m_arg_desc[i];
 
144
        const argument_description &arg_desc = m_arg_desc[t_i];
144
145
 
145
146
        // check for duplicate
146
147
        if( !m_checked_args.hasKey( arg_desc.m_arg_name ) )
163
164
{
164
165
    if( !hasArg( arg_name ) )
165
166
    {
166
 
        std::string msg = m_function_name;
167
 
        msg += "() internal error - getArg called twice of with bad arg_name: ";
168
 
        msg += arg_name;
169
 
        throw Py::AttributeError( msg );
 
167
        std::string msg = m_function_name;
 
168
        msg += "() internal error - getArg called twice of with bad arg_name: ";
 
169
        msg += arg_name;
 
170
        throw Py::AttributeError( msg );
170
171
    }
171
172
    Py::Object arg = m_checked_args[ arg_name ];
172
173
    // Make sure that each arg is only fetched once