class AdLint::Cc1::PrintfFormat::NumberConversionSpecifier

Public Class Methods

new(fmt, trailing_args, env, flags, field_width, prec, len_mod, cs_char) click to toggle source
# File lib/adlint/cc1/format.rb, line 839
def initialize(fmt, trailing_args, env, flags, field_width, prec,
               len_mod, cs_char)
  super(fmt, trailing_args, env, true, flags, field_width, prec, len_mod,
        cs_char)
end

Public Instance Methods

max_length() click to toggle source
# File lib/adlint/cc1/format.rb, line 854
def max_length
  # NOTE: Ruby has the buitin mostly C compliant sprintf.
  if conversion_type.signed?
    (ruby_sprintf_format % conversion_type.min).length
  else
    (ruby_sprintf_format % conversion_type.max).length
  end
end
min_length() click to toggle source
# File lib/adlint/cc1/format.rb, line 849
def min_length
  # NOTE: Ruby has the buitin mostly C compliant sprintf.
  (ruby_sprintf_format % 0).length
end
valid_conversion_specifier_character?() click to toggle source
# File lib/adlint/cc1/format.rb, line 845
def valid_conversion_specifier_character?
  true
end

Private Instance Methods

conversion_type() click to toggle source
# File lib/adlint/cc1/format.rb, line 864
def conversion_type
  subclass_responsibility
end