mirror of
				https://github.com/ruby/ruby.git
				synced 2022-11-09 12:17:21 -05:00 
			
		
		
		
	tool/ruby_vm/models/attribute.rb: void for empty arguments
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
		
							parent
							
								
									52a5f76e8b
								
							
						
					
					
						commit
						55af62599a
					
				
					 1 changed files with 13 additions and 3 deletions
				
			
		|  | @ -32,13 +32,23 @@ class RubyVM::Attribute | |||
|   end | ||||
| 
 | ||||
|   def declaration | ||||
|     argv = @insn.opes.map {|o| o[:decl] }.join(', ') | ||||
|     opes = @insn.opes | ||||
|     if opes.empty? | ||||
|       argv = "void" | ||||
|     else | ||||
|       argv = opes.map {|o| o[:decl] }.join(', ') | ||||
|     end | ||||
|     sprintf '%s %s(%s)', @type, name, argv | ||||
|   end | ||||
| 
 | ||||
|   def definition | ||||
|     argv = @insn.opes.map {|o| "MAYBE_UNUSED(#{o[:decl]})" }.join(",\n    ") | ||||
|     argv = "\n    #{argv}\n" if @insn.opes.size > 1 | ||||
|     opes = @insn.opes | ||||
|     if opes.empty? | ||||
|       argv = "void" | ||||
|     else | ||||
|       argv = opes.map {|o| "MAYBE_UNUSED(#{o[:decl]})" }.join(",\n    ") | ||||
|       argv = "\n    #{argv}\n" if opes.size > 1 | ||||
|     end | ||||
|     sprintf "%s\n%s(%s)", @type, name, argv | ||||
|   end | ||||
| end | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 nobu
						nobu