1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
Commit graph

8920 commits

Author SHA1 Message Date
Andy Wingo
593e2db1dd Refactor hook dispatch in VM
* libguile/vm-engine.c (GOTO_HOOK, HOOK_HANDLER): Split hooks that don't
  take args into a "goto" side and a "target" side.  The idea is to just
  reify the hook call at one place in the binary, since the VM
  continuation is fully in the registers.
  (APPLY_HOOK, PUSH_CONTINUATION_HOOK, NEXT_HOOK)
  (ABORT_CONTINUATION_HOOK): Reimplement in terms of goto hooks.
  (POP_CONTINUATION_HOOK): This one is still old-style.
  (CONTINUE): New helper definition.
  (call, call-label): Move the push-continuation hooks up a bit, so it's
  clear they don't depend on intermediate opcode state.
  (vm_engine): Reify hook handlers for apply, etc.
2018-06-27 19:56:55 +02:00
Andy Wingo
2a8d72f7e0 Microoptimizations to hook dispatch
* libguile/vm.c (vm_dispatch_hook): Add a check that we're in the debug
  engine and the trace level is positive.  Allows us to do cheaper
  checks for when to dispatch hooks.
  (scm_call_n): Just check if trace level is nonzero.
* libguile/vm-engine.c (RUN_HOOK): Likewise just check if trace level is
  nonzero.
2018-06-27 19:26:03 +02:00
Andy Wingo
19cff78bb5 Minor optimizations to debug hook dispatch
* libguile/vm.c (scm_call_n): Only call hooks if the engine supports
  it.
  (vm_dispatch_abort_hook, vm_dispatch_next_hook)
  (vm_dispatch_pop_continuation_hook, vm_dispatch_push_continuation_hook)
  (vm_dispatch_apply_hook, vm_dispatch_hook): Take a thread as arg
  instead of VM, because that will probably already be in a register in
  the VM.  Given that all values are taken relative to the SP, no
  need to pass that either.
* libguile/vm-engine.c (RUN_HOOK0, RUN_HOOK1): Update appropriately.
2018-06-27 19:16:38 +02:00
Andy Wingo
9c8c4060dd Remove "resume" arg from vm engine
* libguile/vm-engine.c (vm_engine): Remove "resume" argument; scm_call_n
  will handle the differences.
* libguile/vm.c (scm_call_n): Inline handling of what to do in normal
  and resume cases.  Remove resume argument to vm_engine.
2018-06-27 18:57:37 +02:00
Andy Wingo
64d114817a Intrinsics take registers from thread
* libguile/continuations.c (scm_i_make_continuation): Remove registers
  argument; instead get from thread.
* libguile/vm-engine.c (vm_engine): Adapt VM engine to not receive a
  registers argument, and thus to not pass it to intrinsics either.
* libguile/intrinsics.h:
* libguile/intrinsics.c (push_prompt):
* libguile/vm.c (capture_continuation, compose_continuation)
  (abort_to_prompt): Refactor these intrinsics to not take a registers
  argument; it's not necessary.
  (scm_call_n): Don't pass registers argument.
2018-06-27 18:42:21 +02:00
Andy Wingo
154a5de3d7 Minor scm_thread refactoring
* libguile/threads.h (scm_thread): Move stack base to be closer to
  related fields, and add a comment for why it's there.
2018-06-27 18:29:46 +02:00
Andy Wingo
18431e6e63 Refactor handling of active VM registers
* libguile/threads.h (scm_thread): Remove unused jmp_buf regs member.
* libguile/vm.h (struct scm_vm): Rename resumable_prompt_cookie to just
  "registers"; we know it's a jmp_buf pointer.
* libguile/vm.c (scm_call_n):
* libguile/throw.c (catch):
* libguile/eval.c (eval):
* libguile/control.c (scm_suspendable_continuation_p): Adapt to cookie
  renaming.
2018-06-27 18:21:04 +02:00
Andy Wingo
fd4eb14751 Use CALL_INTRINSICS helper in VM
* libguile/vm-engine.c (CALL_INTRINSIC): New helper macro.
  (ALLOC_FRAME, vm_engine): Use CALL_INTRINSIC when we need to call
  intrinsics.  GCC still doesn't allocate intrinsics to a register
  though!
2018-06-27 18:07:49 +02:00
Andy Wingo
7e11c992f3 bind-rest inst uses cons-rest intrinsic
* libguile/vm-engine.c (bind-rest): Use cons-rest intrinsic to build the
  rest list.
2018-06-27 17:40:46 +02:00
Andy Wingo
294e627c6b Intrinsic for "prompt"
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
* libguile/intrinsics.c (push_prompt, scm_bootstrap_intrinsics): New
  intrinsic.
* libguile/vm-engine.c (prompt): Use push-prompt intrinsic.
2018-06-27 15:29:49 +02:00
Andy Wingo
85ab5f0299 Remove dedicated current-module instruction.
* libguile/vm-engine.c (current-module): Remove instruction.
2018-06-27 15:06:40 +02:00
Andy Wingo
8918165c40 Compile current-module as intrinsic call
* libguile/fluids.c (scm_i_fluid_ref): New internal function.
  (scm_fluid_ref): Use scm_i_fluid_ref.
* libguile/intrinsics.h:
* libguile/intrinsics.c (current_module): New intrinsic.
* libguile/modules.c (scm_i_current_module): New internal function.
  (scm_current_module): Use new internal function.
* module/language/cps/reify-primitives.scm (compute-known-primitives):
  Add current-module as an intrinsic primitive.
* module/system/vm/assembler.scm (define-scm<-thread-intrinsic):
  (current-module): Arrange to compile to intrinsic call.
2018-06-27 14:57:51 +02:00
Andy Wingo
0faa4144d1 allocate-words intrinsic
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
* libguile/intrinsics.c (allocate_words, scm_bootstrap_intrinsics): New
  intrinsic.
* libguile/vm-engine.c (allocate-words, allocate-words/immediate): Use
  new intrinsic.
2018-06-27 14:56:39 +02:00
Andy Wingo
7883290d88 Inline handling of non-program apply
* libguile/vm.c (vm_apply_non_program_code): Remove, now unneeded.
* libguile/vm-engine.c (vm_engine, call, tail-call, tail-call/shuffle)
  (tail-apply, call/cc): Inline handling of non-programs, as will be the
  case with JIT code.
2018-06-27 13:54:45 +02:00
Andy Wingo
1735cc1fec Apply-non-program is an intrinsic
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
  apply-non-program intrinsic.
* libguile/vm-engine.c (apply-non-program): Replace impl with call to
  intrinsic.
* libguile/vm.c (vm_error_wrong_type_apply): Inline into
  apply_non_program intrinsic.
  (apply_non_program): New intrinsic.
  (scm_bootstrap_vm): Wire it up.
2018-06-27 13:38:30 +02:00
Andy Wingo
6eb4735149 Add intrinsics for error conditions (wrong num args etc)
* libguile/intrinsics.c (error_wrong_num_args, error_no_values)
  (error_not_enough_values, error_wrong_number_of_values): New
  intrinsics.
* libguile/intrinsics.h: Add new intrinsics.
* libguile/vm-engine.c: Signal errors using the new intrinsics.
* libguile/vm.c (vm_error): Remove, now that it's unused.
  (vm_error_bad_instruction): Abort instead of throwing an exception.
  If we get a bad instruction, nothing good will ever happen!
  (compose_continuation): Use wrong-type-arg for unrewindable
  continuations.
  (scm_bootstrap_vm): No need to make "vm-run" or "vm-error" symbols.
2018-06-27 09:47:31 +02:00
Andy Wingo
0ce9a1f870 VM throw uses intrinsics
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add intrinsics for
  throw, throw/value, and throw/value+data.
* libguile/intrinsics.c (throw_, throw_with_value):
  (throw_with_value_and_data): And here they are.
* libguile/vm-engine.c (throw, throw/value, throw/value+data): Use
  intrinsics.
* libguile/vm.c: Remove vm_throw et al.
2018-06-26 20:45:26 +02:00
Andy Wingo
51e71a473f Allow abort_to_prompt to avoid a longjmp
* libguile/vm-engine.c (abort):
* libguile/vm.c (abort_to_prompt): Allow fallthrough if longjmp isn't
  needed.
2018-06-26 17:16:19 +02:00
Andy Wingo
bf66fdca55 Optimize abort-to-prompt to avoid alloca
* libguile/vm.c (capture_delimited_continuation): Adapt to caller not
  truncating vp->sp to vp->fp before calling.
  (abort_to_prompt): Inline vm_abort and avoid the alloca.
2018-06-26 17:08:24 +02:00
Andy Wingo
770360e066 Refactors to abort-to-prompt implementation
* libguile/control.c (scm_abort_to_prompt_star)
* libguile/throw.c (abort_to_prompt): Pass prompt tag and argv in one
  array.
* libguile/vm.c (scm_i_vm_abort): Reimplement as a call into the VM's
  abort_to_prompt builtin.
  (vm_abort): New helper, a copy of scm_i_vm_abort.  Will allow us to
  avoid some arg shuffling when aborting from the VM.
* libguile/vm.h: Remove setjmp include and simplify scm_i_vm_abort
  decl.
2018-06-26 16:39:34 +02:00
Andy Wingo
e7778c62aa abort-to-prompt uses an intrinsic
* libguile/control.h:
* libguile/control.c (scm_i_make_composable_continuation): Rename from
  make_partial_continuation and expose internally.
  (scm_abort_to_prompt_star): Adapt to scm_i_vm_abort name change.
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Define
  abort_to_prompt intrinsic.
* libguile/throw.c (abort_to_prompt): Adapt to scm_i_vm_abort name
  change.
* libguile/vm-engine.c (abort): Use abort_to_prompt intrinsic.
* libguile/vm.c (capture_delimited_continuation): Move here from
  control.c where it was named reify_partial_continuation.
  (scm_i_vm_abort): Move from control.c where it was named
  scm_c_abort (and only exposed internally).
  (abort_to_prompt): New intrinsic, replacing vm_abort.
* libguile/vm.h: Add setjmp include and scm_i_vm_abort decl.
2018-06-26 16:23:02 +02:00
Andy Wingo
03a9b71479 Add rest-arg-length intrinsic.
* libguile/intrinsics.h:
* libguile/vm.c (rest_arg_length): New intrinsic.
  (vm_error_apply_to_non_list): Remove now-unused error proc.
* libguile/vm-engine.c (tail-apply): Use new intrinsic.
2018-06-26 15:34:40 +02:00
Andy Wingo
b4553dbb02 compose-continuation uses an intrinsic
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
  compose-continuation intrinsic.
* libguile/vm-engine.c (compose-continuation): Call compose-continuation
  intrinsic.
* libguile/vm.c (compose_continuation_inner, compose_continuation): Move
  down and rename from vm_reinstate_partial_continuation, and make into
  a form that works as an intrinsic.
2018-06-26 15:10:58 +02:00
Andy Wingo
ba23bc12fd Add intrinsic for call/cc
* libguile/intrinsics.h: Add "capture-continuation" intrinsic.
* libguile/vm-engine.c (call/cc): Rework to use capture_continuation
  intrinsic.
* libguile/vm.c (capture_continuation): New intrinsic.
2018-06-26 12:01:01 +02:00
Andy Wingo
5804c977d7 Rename scm_i_thread to scm_thread
* libguile/scm.h (struct scm_thread, scm_thread): Rename from
  scm_i_thread.
* libguile/deprecated.h (scm_i_thread): Add deprecated typedef.
* libguile/threads.h: Adapt to renaming.
* libguile/intrinsics.h:
* libguile/scmsigs.h:
* libguile/cache-internal.h: Remove threads.h includes; unnecessary with
  the forward decl.
* libguile/continuations.h:
* libguile/gc-inline.h:
* libguile/async.h: Adapt scm_thread type name change.
* libguile/async.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/dynstack.c:
* libguile/dynwind.c:
* libguile/eval.c:
* libguile/finalizers.c:
* libguile/fluids.c:
* libguile/gc.c:
* libguile/intrinsics.c:
* libguile/load.c:
* libguile/memoize.c:
* libguile/print.c:
* libguile/read.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/stackchk.c:
* libguile/stacks.c:
* libguile/symbols.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/vm-engine.c:
* libguile/vm.c: Adapt to type name change, and add additional includes
  as needed.
2018-06-26 11:40:22 +02:00
Andy Wingo
51e35158ba Refactor continuation capture in VM
* libguile/continuations.h:
* libguile/continuations.c (scm_i_make_continuation): Refactor to expect
  registers to already be captured.
* libguile/scm.h (scm_i_thread): Add forward decl.
* libguile/threads.h (struct scm_i_thread): Just fill in the struct
  type.
* libguile/vm-engine.c (call/cc); Use the registers already captured
  before entering the VM.
2018-06-26 11:25:07 +02:00
Andy Wingo
185d19dfb1 Foreign-call intrinsic boxes errno
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
* libguile/foreign.c (foreign_call):
* libguile/vm-engine.c (foreign-call): Change foreign-call intrinsic to
  handle boxing of errno.
2018-06-26 11:09:40 +02:00
Andy Wingo
5e8e816c61 Reinstating undelimited continuations uses intrinsic
* libguile/continuations.h (scm_t_contregs): Remove "struct vm*" member;
  unneeded.
* libguile/continuations.c (scm_i_make_continuation): No need to store
  continuation->vp.
  (scm_i_contregs): New internal function, replaces scm_i_contregs_vp
  and scm_i_contregs_vm_cont.
  (scm_i_check_continuation): Remove; moved to vm.c.
  (scm_i_reinstate_continuation): Add an abort(), to satisfy
  SCM_NORETURN.
* libguile/intrinsics.h: Add new "reinstate-continuation!" intrinsic.
* libguile/vm-engine.c (continuation-call): Use new
  reinstate-continuation! intrinsic.
* libguile/vm.c (vm_return_to_continuation_inner): Move later in the
  file.
  (reinstate_continuation_x): New intrinsic.
  (scm_bootstrap_vm): Init new intrinsic.
2018-06-26 11:09:36 +02:00
Andy Wingo
3b6bf20ef5 Most header files use forward decl for union scm_vm_stack_element
* libguile.h: Add includes for frames.h and vm.h.  Probably need to
  revisit these includes.
* libguile/scm.h (struct scm_frame, union scm_vm_stack_element)
  (struct scm_vm): Add forward declarations.
* libguile/vm.h: Remove frames.h include.
* libguile/foreign.h:
* libguile/gsubr.h: Remove forward decls of union scm_vm_stack_element.
* libguile/control.c:
* libguile/eval.c:
* libguile/print.c: Add frames.h includes.
* libguile/threads.h: Remove continuations.h.
* libguile/vm.c: Add continuations.h.
* libguile/control.h: Swap vm.h include for scm.h include.
* libguile/continuations.h: Add programs.h include for SCM_PROGRAM_P.
2018-06-26 10:55:02 +02:00
Andy Wingo
5448e5a4b0 Add intrinsic for foreign-call
* libguile/Makefile.am (noinst_HEADERS, modinclude_HEADERS): Change to
  not install intrinsics.h.
* libguile/intrinsics.h: Add an error if BUILDING_LIBGUILE isn't set, to
  catch any stray bad inclusions.  Add intrinsic for foreign-call.
* libguile/foreign.c (foreign_call): Rename from scm_i_foreign_call, and
  set as the foreign-call intrinsic.
* libguile/vm-engine.c (foreign-call): Use the intrinsic.  In the future
  we'll want to totally revamp the FFI, if we know that a JIT is
  available!
2018-06-26 09:22:07 +02:00
Andy Wingo
4a2d78b4d4 Give multiple-values objects a tc7
* libguile/scm.h (scm_tc7_values): New tc7.  Never seen by Scheme, so we
  don't need to update it anywhere else.
* libguile/values.h (scm_is_values): New public static inline function.
  (scm_i_nvalues, scm_i_value_ref): New private static inline
  functions.
  (SCM_VALUESP): Use scm_is_value.
  (scm_values_2, scm_values_3): New functions.
  (scm_values_vtable): Remove; values objects are not structs any more.
* libguile/values.c (scm_i_extract_values_2): Adapt to new values
  representation.
  (print_values): Remove now-unused function.
  (scm_c_nvalues): Use scm_i_nvalues.
  (scm_c_value_ref): Use scm_i_value_ref.
  (scm_values, scm_c_values): Make the new-style objects, which store
  their values inline.
  (scm_values_2, scm_values_3): New helpers, to avoid consing little
  useless lists.
* libguile/vm-engine.c (halt, subr-call)
* libguile/eval.c (eval): Adapt to new values representation.
* libguile/i18n.c (scm_locale_string_to_integer)
  (scm_locale_string_to_integer)
* libguile/numbers.c (scm_i_floor_divide, scm_i_ceiling_divide)
  (scm_i_truncate_divide, scm_i_centered_divide, scm_i_round_divide)
  (scm_i_exact_integer_sqrt)
* libguile/r6rs-ports.c (make_bytevector_output_port)
* libguile/srfi-1.c (scm_srfi1_partition, scm_srfi1_partition_x)
* libguile/srfi-14.c (scm_char_set_diff_plus_intersection)
  (scm_char_set_diff_plus_intersection_x)
* libguile/posix.c (scm_getrlimit, scm_open_process): Adapt to use
  scm_values_2 or scm_values_3.
* libguile/print.c (iprin1): Add printer for values objects.
2018-06-25 17:50:29 +02:00
Andy Wingo
08bf4aba30 Add push-interrupt-frame VM intrinsic
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add
  push-interrupt-frame.
* libguile/vm.c (push_interrupt_frame): New intrinsic.  Goal is to
  reduce the amount of inline code the JIT will generate for handling
  interrupts.
* libguile/vm-engine.c (handle-interrupts): Call out to the
  push_interrupt_frame intrinsic in the slow case.
2018-06-25 17:50:28 +02:00
Andy Wingo
8e5755e771 Move VM keyword argument parsing to happen via an intrinsic
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Add new intrinsics
  for binding keyword arguments.
* libguile/vm-engine.c (bind_kwargs): Call intrinsics.
* libguile/vm.c (vm_error_kwargs_missing_value)
  (vm_error_kwargs_invalid_keyword)
  (vm_error_kwargs_unrecognized_keyword): Remove unused error cases.
  (frame_locals_count, alloc_frame): New helper.
  (compute_kwargs_npositional, bind_kwargs, cons_rest): New intrinsics.
  (scm_bootstrap_vm): Define intrinsics.
2018-06-25 17:50:28 +02:00
Andy Wingo
6ceb33e767 expand_stack intrinsic takes thread
* libguile/intrinsics.h (scm_t_thread_sp_intrinsic): Change to take
  thread instead of vp.
  (SCM_FOR_ALL_VM_INTRINSICS): Change expand_stack to expect thread, not
  vp.
* libguile/vm-engine.c (ALLOC_FRAME): Call expand_stack with thread.
* libguile/vm.c (thread_expand_stack, scm_bootstrap_vm): Adapt.
2018-06-25 17:50:27 +02:00
Andy Wingo
150f3474df Fix intrinsics copyright line and include guards
* libguile/intrinsics.h: Fix include guard comment and copyright line.
2018-06-25 17:50:27 +02:00
Andy Wingo
eecb72746a VM gets VP from thread
* libguile/vm.c (scm_t_vm_engine, scm_call_n): Remove "vp" argument.
* libguile/vm-engine.c (VP): New macro, to get VP from thread.  Replace
  all uses of vp with this.
2018-06-25 17:50:22 +02:00
Andy Wingo
7f7169847e Eagerly initialize thread VM; remove scm_the_vm
* libguile/threads.c (thread_mark): Unconditionally call
  scm_i_vm_mark_stack.
  (guilify_self_1): Eagerly prepare the thread stack, before entering
  Guile mode.  It's only a page of mmap, after all.
* libguile/vm.c (scm_i_vm_prepare_stack): Rename from init_vm.
  (thread_vm, scm_the_vm): Remove.
  (VM_DEFINE_HOOK, scm_vm_trace_level, scm_set_vm_trace_level_x)
  (scm_vm_engine, scm_c_set_vm_engine_x, scm_i_capture_current_stack)
  (scm_call_n, scm_call_with_stack_overflow_handler): Adapt to get VM
  from thread.
  (scm_i_vm_free_stack): Memset the whole thing to 0 when we're done.
* libguile/control.c (scm_abort_to_prompt_star)
* libguile/eval.c (eval):
* libguile/throw.c (catch, abort_to_prompt): Get VM from thread.
2018-06-25 17:49:50 +02:00
Andy Wingo
2480761bde Inline struct scm_vm into struct scm_i_thread
* libguile/threads.h (scm_i_thread): Inline struct scm_vm into struct
  scm_i_thread, as these exist in a one-to-one relationship.
* libguile/threads.c (guilify_self_1, thread_mark, on_thread_exit):
* libguile/control.c (scm_suspendable_continuation_p):
* libguile/vm.c (init_vm, thread_vm): Adapt users.
2018-06-24 08:59:42 +02:00
Andy Wingo
aad5bfed60 Add __scm.h placeholder
* libguile/__scm.h: Add file, mistakenly removed in a previous commit.
2018-06-24 08:47:32 +02:00
Andy Wingo
38e2c2c6b1 Deprecate scm_t_uint8 and similar typedefs
* libguile/deprecated.h (SCM_DEPRECATED_TYPE): New helper define;
  removed after.
  (scm_t_int8, scm_t_uint8, scm_t_int16, scm_t_uint16)
  (scm_t_int32, scm_t_uint32, scm_t_intmax, scm_t_uintmax)
  (scm_t_intptr, scm_t_uintptr, scm_t_int64 scm_t_uint64)
  (scm_t_ptrdiff): Deprecate these types.  Even on Guile 2.2 people
  should use the stdint types.
2018-06-21 20:20:04 +02:00
Andy Wingo
6ad1fc9ce0 Use ptrdiff_t instead of scm_t_ptrdiff
* libguile/continuations.h:
* libguile/control.c:
* libguile/control.h:
* libguile/dynstack.c:
* libguile/dynstack.h:
* libguile/eval.c:
* libguile/foreign.c:
* libguile/frames.h:
* libguile/gen-scmconfig.c:
* libguile/gsubr.c:
* libguile/gsubr.h:
* libguile/loader.c:
* libguile/numbers.h:
* libguile/stacks.c:
* libguile/throw.c:
* libguile/vm-engine.c:
* libguile/vm.c:
* libguile/vm.h: Use ptrdiff_t from stddef.h.
2018-06-21 20:20:01 +02:00
Andy Wingo
16879cabed Replace uses of scm_t_int8, scm_t_uintmax, etc with stdint types
* libguile/bitvectors.c:
* libguile/bitvectors.h:
* libguile/bytevectors.c:
* libguile/bytevectors.h:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/conv-integer.i.c:
* libguile/conv-uinteger.i.c:
* libguile/dynstack.c:
* libguile/dynstack.h:
* libguile/foreign.c:
* libguile/frames.c:
* libguile/frames.h:
* libguile/gc-inline.h:
* libguile/gc.h:
* libguile/gsubr.c:
* libguile/gsubr.h:
* libguile/hash.c:
* libguile/i18n.c:
* libguile/instructions.c:
* libguile/intrinsics.c:
* libguile/intrinsics.h:
* libguile/loader.c:
* libguile/loader.h:
* libguile/numbers.c:
* libguile/numbers.h:
* libguile/pairs.c:
* libguile/ports-internal.h:
* libguile/ports.c:
* libguile/ports.h:
* libguile/posix.c:
* libguile/print.c:
* libguile/print.h:
* libguile/programs.c:
* libguile/programs.h:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/random.h:
* libguile/scm.h:
* libguile/socket.c:
* libguile/srfi-4.c:
* libguile/srfi-4.h:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/struct.c:
* libguile/struct.h:
* libguile/symbols.c:
* libguile/threads.c:
* libguile/threads.h:
* libguile/uniform.c:
* libguile/vm-engine.c:
* libguile/vm.c:
* libguile/vm.h:
* libguile/vports.c:
* test-suite/standalone/test-conversion.c:
* test-suite/standalone/test-ffi-lib.c:
* test-suite/standalone/test-scm-take-u8vector.c:
* test-suite/standalone/test-srfi-4.c: Replace e.g. scm_t_uint8 with
  uint8_t.
2018-06-21 20:18:54 +02:00
Andy Wingo
5e5afde06f Start to use C99 stdint in gen-scmconfig
* configure.ac: Remove checks for stdint.h; we require C99 so it must be
  there; and in any case for our purposes we use gnulib, so it will be
  there.  No need to check for inttypes.h.  No need to check for what
  type maps to e.g. uint32_t either.
* libguile/deprecated.h (SCM_HAVE_T_INT64, SCM_HAVE_T_UINT64): Deprecate
  these, as they are always 1.
  (SCM_HAVE_ARRAYS): Likewise deprecate; it's always 1.
* libguile/gen-scmconfig.c: Always include stdint.h and stddef.h, and
  make it so that scmconfig.h also includes these.  Use C99 types.
* libguile/gen-scmconfig.h.in: Remove configure-substed vars that are no
  longer defined.
2018-06-21 08:08:58 +02:00
Andy Wingo
1234bb1850 Update license notices in all C files
Update to newest recommended license notices from the FSF.  Everything
stays LGPLv3+ except guile-readline which is GPLv3+.
2018-06-20 20:07:34 +02:00
Andy Wingo
c836c28496 libguile header files have uniform format for copyright declarations 2018-06-20 19:44:45 +02:00
Andy Wingo
791eb0c01a Remove (C) from copyright statements
As the FSF advises, 'There is no legal significance to using the
three-character sequence “(C)”, but it does no harm.'  It does take up
space though!  For that reason, we remove it here from our C files.
2018-06-20 19:17:06 +02:00
Andy Wingo
dd8add2fa0 Make .c copyright headers uniform 2018-06-20 18:48:30 +02:00
Andy Wingo
b8d757732f Rationalize include order in C files
Include config.h first, then system includes, then libguile includes, in
alphabetical order, then the include for the file in question.
2018-06-20 18:31:24 +02:00
Andy Wingo
3068bc7384 Make libguile header inclusion consistent within libguile c files
Change from '#include "libguile/foo.h"' and '#include <libguile/foo.h>'
to '#include "foo.h"'.
2018-06-20 17:19:31 +02:00
Andy Wingo
97cc65fee4 Rename __scm.h to scm.h
* libguile/scm.h: Rename.  Update all includers.
2018-06-20 16:33:33 +02:00