Skip to content

Commit

Permalink
add missing Smake_flvector implementation (#881)
Browse files Browse the repository at this point in the history
  • Loading branch information
payneca authored Oct 26, 2024
1 parent 399fb7f commit 9165b1f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion boot/pb/scheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ EXPORT ptr Ssymbol_to_string(ptr);
EXPORT ptr Sflonum(double);
EXPORT ptr Smake_vector(iptr, ptr);
EXPORT ptr Smake_fxvector(iptr, ptr);
EXPORT ptr Smake_flvector(iptr, ptr);
EXPORT ptr Smake_flvector(iptr, double);
EXPORT ptr Smake_bytevector(iptr, int);
EXPORT ptr Smake_string(iptr, int);
EXPORT ptr Smake_uninitialized_string(iptr);
Expand Down
8 changes: 8 additions & 0 deletions c/schlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ ptr Smake_fxvector(iptr n, ptr x) {
return p;
}

ptr Smake_flvector(iptr n, double x) {
ptr p; iptr i;

p = S_flvector(n);
for (i = 0; i < n; i += 1) Sflvector_set(p, i, x);
return p;
}

ptr Smake_bytevector(iptr n, int x) {
ptr p; iptr i;

Expand Down
6 changes: 4 additions & 2 deletions csug/foreign.stex
Original file line number Diff line number Diff line change
Expand Up @@ -3579,14 +3579,16 @@ that it takes a C string (character pointer) as input.
\end{flushleft}

\noindent
\scheme{Smake_string}, \scheme{Smake_vector}, \scheme{Smake_bytevector},
and \scheme{Smake_fxvector} are similar to their Scheme counterparts.
\scheme{Smake_string}, \scheme{Smake_vector},
\scheme{Smake_bytevector}, \scheme{Smake_fxvector}, and
\scheme{Smake_flvector} are similar to their Scheme counterparts.

\begin{flushleft}
\cfunction{ptr}{Smake_string}{iptr \var{n}, int \var{c}}
\cfunction{ptr}{Smake_vector}{iptr \var{n}, ptr \var{obj}}
\cfunction{ptr}{Smake_bytevector}{iptr \var{n}, int \var{fill}}
\cfunction{ptr}{Smake_fxvector}{iptr \var{n}, ptr \var{fixnum}}
\cfunction{ptr}{Smake_flvector}{iptr \var{n}, double \var{flonum}}
\end{flushleft}

\noindent
Expand Down
6 changes: 6 additions & 0 deletions release_notes/release_notes.stex
Original file line number Diff line number Diff line change
Expand Up @@ -2812,6 +2812,12 @@ and \scheme{bytevector-reference-set!}. In addition, the garbage
collector would fail to preserve the last few bytes of a reference
bytevector whose length is not a multiple of the word size.

\subsection{Missing C implementation for \scheme{Smake_flvector} (10.1.0)}

The header file scheme.h Scheme defines \scheme{Smake_flvector}, but
Chez Scheme does not provide an implmentation. The
\scheme{Smake_flvector} function is now implemented.

\subsection{\scheme{library-exports} for library that is not yet imported (10.0.0)}

When visiting or loading a separately compiled library,
Expand Down
2 changes: 1 addition & 1 deletion s/mkheader.ss
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@
(export "ptr" "Sflonum" "(double)")
(export "ptr" "Smake_vector" "(iptr, ptr)")
(export "ptr" "Smake_fxvector" "(iptr, ptr)")
(export "ptr" "Smake_flvector" "(iptr, ptr)")
(export "ptr" "Smake_flvector" "(iptr, double)")
(export "ptr" "Smake_bytevector" "(iptr, int)")
(export "ptr" "Smake_string" "(iptr, int)")
(export "ptr" "Smake_uninitialized_string" "(iptr)")
Expand Down

0 comments on commit 9165b1f

Please sign in to comment.