mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
- Revert: Change index parameter types from int to size_t to make 0-based range implicit.
- Add checks that index values are >= 0. git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@409 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
@@ -114,6 +114,14 @@ def make_cpptoc_function_impl_new(name, func, defined_names):
|
||||
'\n if ('+arg_name+'Count > 0 && !'+arg_name+')'\
|
||||
'\n return'+retval_default+';'
|
||||
|
||||
# check index params
|
||||
index_params = arg.parent.get_attrib_list('index_param')
|
||||
if not index_params is None and arg_name in index_params:
|
||||
result += comment+\
|
||||
'\n DCHECK('+arg_name+' >= 0);'\
|
||||
'\n if ('+arg_name+' < 0)'\
|
||||
'\n return'+retval_default+';'
|
||||
|
||||
if len(optional) > 0:
|
||||
result += '\n // Unverified params: '+string.join(optional,', ')
|
||||
|
||||
|
@@ -118,7 +118,15 @@ def make_ctocpp_function_impl_new(clsname, name, func):
|
||||
result += comment+\
|
||||
'\n DCHECK(!'+arg_name+'.empty());'\
|
||||
'\n if ('+arg_name+'.empty())'\
|
||||
'\n return'+retval_default+';'
|
||||
'\n return'+retval_default+';'
|
||||
|
||||
# check index params
|
||||
index_params = arg.parent.get_attrib_list('index_param')
|
||||
if not index_params is None and arg_name in index_params:
|
||||
result += comment+\
|
||||
'\n DCHECK('+arg_name+' >= 0);'\
|
||||
'\n if ('+arg_name+' < 0)'\
|
||||
'\n return'+retval_default+';'
|
||||
|
||||
if len(optional) > 0:
|
||||
result += '\n // Unverified params: '+string.join(optional,', ')
|
||||
|
@@ -79,6 +79,8 @@ Supported method/function attributes:
|
||||
resulting C API function.
|
||||
optional_param=[param] (Optional) Parameter name that will be optional
|
||||
instead of required.
|
||||
index_param=[param] (Optional) Parameter name representing an index
|
||||
value that will be verified as >= 0.
|
||||
default_retval=[string] (Required for enumeration types, Optional for other
|
||||
types) Specify the default return value.
|
||||
count_func=[param:func] (Required for non-const non-string std::vector
|
||||
|
Reference in New Issue
Block a user