Skip to content

Commit

Permalink
Moved exported symbols in internal/util.h to ruby/util.h
Browse files Browse the repository at this point in the history
[Feature #18051]
  • Loading branch information
nobu committed Aug 24, 2021
1 parent 4794a8a commit c38c2d8
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 17 deletions.
1 change: 0 additions & 1 deletion bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
#include "internal/numeric.h"
#include "internal/object.h"
#include "internal/sanitizers.h"
#include "internal/util.h"
#include "internal/variable.h"
#include "internal/warnings.h"
#include "ruby/thread.h"
Expand Down
11 changes: 4 additions & 7 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2111,7 +2111,6 @@ bignum.$(OBJEXT): $(top_srcdir)/internal/object.h
bignum.$(OBJEXT): $(top_srcdir)/internal/sanitizers.h
bignum.$(OBJEXT): $(top_srcdir)/internal/serial.h
bignum.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
bignum.$(OBJEXT): $(top_srcdir)/internal/util.h
bignum.$(OBJEXT): $(top_srcdir)/internal/variable.h
bignum.$(OBJEXT): $(top_srcdir)/internal/vm.h
bignum.$(OBJEXT): $(top_srcdir)/internal/warnings.h
Expand Down Expand Up @@ -3436,7 +3435,6 @@ debug.$(OBJEXT): $(top_srcdir)/internal/imemo.h
debug.$(OBJEXT): $(top_srcdir)/internal/serial.h
debug.$(OBJEXT): $(top_srcdir)/internal/signal.h
debug.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
debug.$(OBJEXT): $(top_srcdir)/internal/util.h
debug.$(OBJEXT): $(top_srcdir)/internal/vm.h
debug.$(OBJEXT): $(top_srcdir)/internal/warnings.h
debug.$(OBJEXT): {$(VPATH)}assert.h
Expand Down Expand Up @@ -7881,7 +7879,6 @@ math.$(OBJEXT): {$(VPATH)}st.h
math.$(OBJEXT): {$(VPATH)}subst.h
memory_view.$(OBJEXT): $(hdrdir)/ruby/ruby.h
memory_view.$(OBJEXT): $(top_srcdir)/internal/hash.h
memory_view.$(OBJEXT): $(top_srcdir)/internal/util.h
memory_view.$(OBJEXT): $(top_srcdir)/internal/variable.h
memory_view.$(OBJEXT): {$(VPATH)}assert.h
memory_view.$(OBJEXT): {$(VPATH)}backward/2/assume.h
Expand Down Expand Up @@ -8045,6 +8042,7 @@ memory_view.$(OBJEXT): {$(VPATH)}missing.h
memory_view.$(OBJEXT): {$(VPATH)}node.h
memory_view.$(OBJEXT): {$(VPATH)}st.h
memory_view.$(OBJEXT): {$(VPATH)}subst.h
memory_view.$(OBJEXT): {$(VPATH)}util.h
memory_view.$(OBJEXT): {$(VPATH)}vm_debug.h
memory_view.$(OBJEXT): {$(VPATH)}vm_sync.h
miniinit.$(OBJEXT): $(CCAN_DIR)/check_type/check_type.h
Expand Down Expand Up @@ -9277,7 +9275,6 @@ pack.$(OBJEXT): $(top_srcdir)/internal/compilers.h
pack.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
pack.$(OBJEXT): $(top_srcdir)/internal/string.h
pack.$(OBJEXT): $(top_srcdir)/internal/symbol.h
pack.$(OBJEXT): $(top_srcdir)/internal/util.h
pack.$(OBJEXT): $(top_srcdir)/internal/variable.h
pack.$(OBJEXT): $(top_srcdir)/internal/warnings.h
pack.$(OBJEXT): {$(VPATH)}assert.h
Expand Down Expand Up @@ -9444,6 +9441,7 @@ pack.$(OBJEXT): {$(VPATH)}pack.c
pack.$(OBJEXT): {$(VPATH)}pack.rbinc
pack.$(OBJEXT): {$(VPATH)}st.h
pack.$(OBJEXT): {$(VPATH)}subst.h
pack.$(OBJEXT): {$(VPATH)}util.h
parse.$(OBJEXT): $(hdrdir)/ruby.h
parse.$(OBJEXT): $(hdrdir)/ruby/ruby.h
parse.$(OBJEXT): $(top_srcdir)/internal/array.h
Expand All @@ -9467,7 +9465,6 @@ parse.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
parse.$(OBJEXT): $(top_srcdir)/internal/string.h
parse.$(OBJEXT): $(top_srcdir)/internal/symbol.h
parse.$(OBJEXT): $(top_srcdir)/internal/thread.h
parse.$(OBJEXT): $(top_srcdir)/internal/util.h
parse.$(OBJEXT): $(top_srcdir)/internal/variable.h
parse.$(OBJEXT): $(top_srcdir)/internal/vm.h
parse.$(OBJEXT): $(top_srcdir)/internal/warnings.h
Expand Down Expand Up @@ -12757,7 +12754,6 @@ sprintf.$(OBJEXT): $(top_srcdir)/internal/serial.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/string.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/symbol.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/util.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/vm.h
sprintf.$(OBJEXT): $(top_srcdir)/internal/warnings.h
sprintf.$(OBJEXT): {$(VPATH)}assert.h
Expand Down Expand Up @@ -12925,6 +12921,7 @@ sprintf.$(OBJEXT): {$(VPATH)}regex.h
sprintf.$(OBJEXT): {$(VPATH)}sprintf.c
sprintf.$(OBJEXT): {$(VPATH)}st.h
sprintf.$(OBJEXT): {$(VPATH)}subst.h
sprintf.$(OBJEXT): {$(VPATH)}util.h
sprintf.$(OBJEXT): {$(VPATH)}vsnprintf.c
st.$(OBJEXT): $(hdrdir)/ruby.h
st.$(OBJEXT): $(hdrdir)/ruby/ruby.h
Expand Down Expand Up @@ -13097,7 +13094,6 @@ strftime.$(OBJEXT): $(top_srcdir)/internal/compilers.h
strftime.$(OBJEXT): $(top_srcdir)/internal/serial.h
strftime.$(OBJEXT): $(top_srcdir)/internal/static_assert.h
strftime.$(OBJEXT): $(top_srcdir)/internal/string.h
strftime.$(OBJEXT): $(top_srcdir)/internal/util.h
strftime.$(OBJEXT): $(top_srcdir)/internal/vm.h
strftime.$(OBJEXT): {$(VPATH)}assert.h
strftime.$(OBJEXT): {$(VPATH)}backward/2/assume.h
Expand Down Expand Up @@ -13260,6 +13256,7 @@ strftime.$(OBJEXT): {$(VPATH)}st.h
strftime.$(OBJEXT): {$(VPATH)}strftime.c
strftime.$(OBJEXT): {$(VPATH)}subst.h
strftime.$(OBJEXT): {$(VPATH)}timev.h
strftime.$(OBJEXT): {$(VPATH)}util.h
string.$(OBJEXT): $(hdrdir)/ruby.h
string.$(OBJEXT): $(hdrdir)/ruby/ruby.h
string.$(OBJEXT): $(top_srcdir)/internal/array.h
Expand Down
1 change: 0 additions & 1 deletion debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "eval_intern.h"
#include "id.h"
#include "internal/signal.h"
#include "internal/util.h"
#include "ruby/encoding.h"
#include "ruby/io.h"
#include "ruby/ruby.h"
Expand Down
4 changes: 4 additions & 0 deletions include/ruby/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ RBIMPL_SYMBOL_EXPORT_BEGIN()
#define DECIMAL_SIZE_OF_BITS(n) (((n) * 3010 + 9998) / 9999)
/* an approximation of ceil(n * log10(2)), up to 65536 at least */

RUBY_EXTERN const signed char ruby_digit36_to_number_table[];
RUBY_EXTERN const char ruby_hexdigits[];

unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
#define scan_oct(s,l,e) ((int)ruby_scan_oct((s),(l),(e)))
unsigned long ruby_scan_oct(const char *, size_t, size_t *);
#define scan_hex(s,l,e) ((int)ruby_scan_hex((s),(l),(e)))
Expand Down
3 changes: 0 additions & 3 deletions internal/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ char *ruby_hdtoa(double d, const char *xdigs, int ndigits, int *decpt, int *sign

RUBY_SYMBOL_EXPORT_BEGIN
/* util.c (export) */
extern const signed char ruby_digit36_to_number_table[];
extern const char ruby_hexdigits[];
extern unsigned long ruby_scan_digits(const char *str, ssize_t len, int base, size_t *retlen, int *overflow);
RUBY_SYMBOL_EXPORT_END

#endif /* INTERNAL_UTIL_H */
2 changes: 1 addition & 1 deletion memory_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include "internal.h"
#include "internal/hash.h"
#include "internal/variable.h"
#include "internal/util.h"
#include "ruby/memory_view.h"
#include "ruby/util.h"
#include "vm_sync.h"

#if SIZEOF_INTPTR_T == SIZEOF_LONG_LONG
Expand Down
2 changes: 1 addition & 1 deletion pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#include "internal/bits.h"
#include "internal/string.h"
#include "internal/symbol.h"
#include "internal/util.h"
#include "internal/variable.h"
#include "ruby/util.h"

#include "builtin.h"

Expand Down
1 change: 0 additions & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ struct lex_context;
#include "internal/re.h"
#include "internal/symbol.h"
#include "internal/thread.h"
#include "internal/util.h"
#include "internal/variable.h"
#include "node.h"
#include "probes.h"
Expand Down
2 changes: 1 addition & 1 deletion sprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "internal/object.h"
#include "internal/sanitizers.h"
#include "internal/symbol.h"
#include "internal/util.h"
#include "ruby/encoding.h"
#include "ruby/re.h"
#include "ruby/util.h"

#define BIT_DIGITS(N) (((N)*146)/485 + 1) /* log2(10) =~ 146/485 */

Expand Down
2 changes: 1 addition & 1 deletion strftime.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@

#include "internal.h"
#include "internal/string.h"
#include "internal/util.h"
#include "internal/vm.h"
#include "ruby/encoding.h"
#include "ruby/ruby.h"
#include "ruby/util.h"
#include "timev.h"

/* defaults: season to taste */
Expand Down

0 comments on commit c38c2d8

Please sign in to comment.