Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow #43

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft

Flow #43

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rubocop
  • Loading branch information
TApplencourt committed Sep 26, 2022
commit 60ae16b4c87a7f8367fce59c2e91f8fe5ebc2fc2
18 changes: 9 additions & 9 deletions utils/gen_babeltrace_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def bt_set_conditionally(guard)
module BTPrinter
@@output = ''
@@indent = 0
INDENT_INCREMENT = ' '
INDENT_INCREMENT = ' '.freeze

def pr(str)
@@output << INDENT_INCREMENT * @@indent << str << "\n"
Expand Down Expand Up @@ -132,9 +132,9 @@ def get_declarator(self_component:, variable:)
end

class BTStreamClass
include BTLocator
include BTPrinter
include BTUtils
include BTPrinter
include BTLocator
extend BTFromH
attr_reader :packet_context_field_class, :event_common_context_field_class, :event_classes, :id, :name

Expand All @@ -143,7 +143,7 @@ def initialize(parent:, name: nil, packet_context_field_class: nil, event_common
@parent = parent
@name = name

raise 'Two packet_context' if packet_context_field_class and packet_context
raise 'Two packet_context' if packet_context_field_class && packet_context

# Should put assert to check for struct
@packet_context_field_class = BTFieldClass.from_h(self, packet_context_field_class) if packet_context_field_class
Expand Down Expand Up @@ -215,8 +215,8 @@ def get_declarator(trace_class:, variable:)
end

class BTEventClass
include BTLocator
include BTPrinter
include BTLocator
extend BTFromH
attr_reader :name, :specific_context_field_class, :payload_field_class

Expand Down Expand Up @@ -323,7 +323,7 @@ def initialize(parent:, field_value_range: nil, preferred_display_base: nil)
@preferred_display_base = preferred_display_base
end

def get_declarator(variable:, trace_class: nil)
def get_declarator(variable:)
pr "bt_field_class_integer_set_field_value_range(#{variable}, #{@field_value_range});" if @field_value_range
if @preferred_display_base
pr "bt_field_class_integer_set_preferred_display_base(#{variable}, #{@preferred_display_base});"
Expand All @@ -336,15 +336,15 @@ class BTFieldClass::Integer::Unsigned < BTFieldClass::Integer
extend BTFromH
def get_declarator(trace_class:, variable:)
pr "#{variable} = bt_field_class_integer_unsigned_create(#{trace_class});"
super
super(variable: variable)
end
end

class BTFieldClass::Integer::Signed < BTFieldClass::Integer
extend BTFromH
def get_declarator(trace_class:, variable:)
pr "#{variable} = bt_field_class_integer_signed_create(#{trace_class});"
super
super(variable: variable)
end
end

Expand Down Expand Up @@ -623,5 +623,5 @@ def initialize(parent:, options:, selector_field_class: nil)
'option_with_selector_field_unsigned' => BTFieldClass::Option::WithSelectorField::IntegerUnsigned,
'option_with_selector_field_signed' => BTFieldClass::Option::WithSelectorField::IntegerSigned,
'variant' => BTFieldClass::Variant
}
}.freeze
end