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

Fix typos #3173

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Full commit log can be found at <https://github.com/jqlang/jq/compare/jq-1.6...j
- Fix `contains/1` to handle strings with NUL. @nicowilliams 61cd6db
- Fix `stderr/0` to output raw text without any decoration. @itchyny #2751
- Fix `nth/2` to emit empty on index out of range. @itchyny #2674
- Fix `implode` to not assert and instead replace invalid unicode codepoints. @wader #2646
- Fix `implode` to not assert and instead replace invalid Unicode codepoints. @wader #2646
- Fix `indices/1` and `rindex/1` in case of overlapping matches in strings. @emanuele6 #2718
- Fix `sub/3` to resolve issues involving global search-and-replace (gsub) operations. @pkoppstein #2641
- Fix `significand/0`, `gamma/0` and `drem/2` to be available on macOS. @itchyny #2756 #2775
Expand Down
2 changes: 1 addition & 1 deletion docs/content/manual/dev/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ sections:
future to include the version strings for the build
tooling used.

Note that this can be overriden in the command-line
Note that this can be overridden in the command-line
with `--arg` and related options.

- title: "`$ENV`, `env`"
Expand Down
2 changes: 1 addition & 1 deletion docs/content/manual/v1.7/manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1980,7 +1980,7 @@ sections:
future to include the version strings for the build
tooling used.

Note that this can be overriden in the command-line
Note that this can be overridden in the command-line
with `--arg` and related options.

- title: "`$ENV`, `env`"
Expand Down
6 changes: 3 additions & 3 deletions docs/content/tutorial/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ body:
"name": "Nico Williams"
}
{
"message": "Fix iterration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",
"message": "Fix iteration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you aware that this is a commit message of this repository? Fixing typos like this example looks not just meaningless, but lacks well investigation of the context.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not trying to waste anybody's time, I saw a typo in an OSS project that I like and I fixed it.
I agree that this PR is far less "meaningful" now that the decNumber fixes are out of scope - feel free to close it.

"name": "Nico Williams"
}
{
Expand Down Expand Up @@ -249,7 +249,7 @@ body:
"name": "Nico Williams"
},
{
"message": "Fix iterration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",
"message": "Fix iteration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",
"name": "Nico Williams"
},
{
Expand Down Expand Up @@ -300,7 +300,7 @@ body:
]
},
{
"message": "Fix iterration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",
"message": "Fix iteration problem for non decimal string\n\nWhen the string transformation to number failed, all following\ntransformation failed too.\n\nThis happend because status in decNumberFromString function is\nupdated just in error case. Reusing the DEC_CONTEXT that failed\nbefore results into error even if the string is valid number.",
"name": "Nico Williams",
"parents": [
"https://github.com/jqlang/jq/commit/174db0f93552bdb551ae1f3c5c64744df0ad8e2f"
Expand Down
2 changes: 1 addition & 1 deletion jq.1.prebuilt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions src/decNumber/decBasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static decFloat * decCanonical(decFloat *result, const decFloat *df) {
#endif
} // block

// Loop to repair a non-canonical coefficent, as needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a third-party library, so please drop the changes, and report to the upstream if you can.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I didn't realise. I'm used to seeing copied dependencies in "vendor" or "third_party" folders.

// Loop to repair a non-canonical coefficient, as needed
inword=DECWORDS-1; // current input word
uoff=0; // bit offset of declet
encode=DFWORD(result, inword);
Expand Down Expand Up @@ -168,7 +168,7 @@ static decFloat * decDivide(decFloat *result, const decFloat *dfl,
const decFloat *dfr, decContext *set, uInt op) {
decFloat quotient; // for remainders
bcdnum num; // for final conversion
uInt acc[DIVACCLEN]; // coefficent in base-billion ..
uInt acc[DIVACCLEN]; // coefficient in base-billion ..
uInt div[DIVOPLEN]; // divisor in base-billion ..
uInt quo[DIVOPLEN+1]; // quotient in base-billion ..
uByte bcdacc[(DIVOPLEN+1)*9+2]; // for quotient in BCD, +1, +1
Expand Down Expand Up @@ -245,7 +245,7 @@ static decFloat * decDivide(decFloat *result, const decFloat *dfl,
} // 0/x
// [here, both operands are known to be finite and non-zero]

// extract the operand coefficents into 'units' which are
// extract the operand coefficients into 'units' which are
// base-billion; the lhs is high-aligned in acc and the msu of both
// acc and div is at the right-hand end of array (offset length-1);
// the quotient can need one more unit than the operands as digits
Expand Down Expand Up @@ -716,7 +716,7 @@ static void decFiniteMultiply(bcdnum *num, uByte *bcdacc,
#if DECUSE64
uLong accl[MULACCLEN]; // lazy accumulator (base-billion+)
uLong *pl; // work -> lazy accumulator
uInt acc[MULACCLEN]; // coefficent in base-billion ..
uInt acc[MULACCLEN]; // coefficient in base-billion ..
#else
uInt acc[MULACCLEN*2]; // accumulator in base-billion ..
#endif
Expand Down Expand Up @@ -2660,7 +2660,7 @@ decFloat * decFloatMultiply(decFloat *result,
const decFloat *dfl, const decFloat *dfr,
decContext *set) {
bcdnum num; // for final conversion
uByte bcdacc[DECPMAX9*18+1]; // for coefficent in BCD
uByte bcdacc[DECPMAX9*18+1]; // for coefficient in BCD

if (DFISSPECIAL(dfl) || DFISSPECIAL(dfr)) { // either is special?
// NaNs are handled as usual
Expand Down Expand Up @@ -2700,7 +2700,7 @@ decFloat * decFloatNextMinus(decFloat *result, const decFloat *dfl,
DFSETNMAX(result);
return result; // [no status to set]
}
// other cases are effected by sutracting a tiny delta -- this
// other cases are effected by subtracting a tiny delta -- this
// should be done in a wider format as the delta is unrepresentable
// here (but can be done with normal add if the sign of zero is
// treated carefully, because no Inexactitude is interesting);
Expand Down Expand Up @@ -2744,7 +2744,7 @@ decFloat * decFloatNextPlus(decFloat *result, const decFloat *dfl,
DFWORD(result, 0)|=DECFLOAT_Sign; // make negative
return result; // [no status to set]
}
// other cases are effected by sutracting a tiny delta -- this
// other cases are effected by subtracting a tiny delta -- this
// should be done in a wider format as the delta is unrepresentable
// here (but can be done with normal add if the sign of zero is
// treated carefully, because no Inexactitude is interesting);
Expand Down Expand Up @@ -3071,7 +3071,7 @@ decFloat * decFloatQuantize(decFloat *result,
} // inexact rounding

// now clear zeros to the left so exactly DECPMAX digits will be
// available in the coefficent -- the first word to the left was
// available in the coefficient -- the first word to the left was
// cleared earlier for safe carry; now add any more needed
if (drop>4) {
UBFROMUI(BUFOFF-8, 0); // must be at least 5
Expand All @@ -3090,7 +3090,7 @@ decFloat * decFloatQuantize(decFloat *result,
ulsd=BUFOFF+DECPMAX-1;
}
else { // padding will fit (but may still be too long)
// final-word mask depends on endianess
// final-word mask depends on endianness
#if DECLITEND
static const uInt dmask[]={0, 0x000000ff, 0x0000ffff, 0x00ffffff};
#else
Expand Down Expand Up @@ -3832,7 +3832,7 @@ static uInt decToInt32(const decFloat *df, decContext *set,
set->status|=DEC_Invalid_operation; // Invalid or out of range
return 0;
}
// get last twelve digits of the coefficent into hi & ho, base
// get last twelve digits of the coefficient into hi & ho, base
// 10**9 (see GETCOEFFBILL):
sourlo=DFWORD(&result, DECWORDS-1);
lo=DPD2BIN0[sourlo&0x3ff]
Expand Down
6 changes: 3 additions & 3 deletions src/decNumber/decCommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static decFloat * decFinalize(decFloat *df, bcdnum *num,
#if DECCHECK
Int clen=ulsd-umsd+1;
#if QUAD
#define COEXTRA 2 // extra-long coefficent
#define COEXTRA 2 // extra-long coefficient
#else
#define COEXTRA 0
#endif
Expand Down Expand Up @@ -701,7 +701,7 @@ decFloat * decFloatFromPacked(decFloat *df, Int exp, const uByte *packed) {
/* returns df, which will be canonical or NULL if any of the */
/* requirements are not met (if this case df is unchanged); that */
/* is, the input data must be as returned by decFloatToPacked, */
/* except that all six sign codes are acccepted. */
/* except that all six sign codes are accepted. */
/* */
/* No status will be set. */
/* ------------------------------------------------------------------ */
Expand Down Expand Up @@ -783,7 +783,7 @@ decFloat * decFloatFromString(decFloat *result, const char *string,
uInt uiwork; // for macros
bcdnum num; // collects data for finishing
uInt error=DEC_Conversion_syntax; // assume the worst
uByte buffer[ROUNDUP(DECSTRING+11, 8)]; // room for most coefficents,
uByte buffer[ROUNDUP(DECSTRING+11, 8)]; // room for most coefficients,
// some common rounding, +3, & pad
#if DECTRACE
// printf("FromString %s ...\n", string);
Expand Down
2 changes: 1 addition & 1 deletion src/decNumber/decContext.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ uInt decContextGetStatus(decContext *context) {
/* newstatus is the source for the bits to be restored */
/* mask indicates the bits to be restored (the status bit that */
/* corresponds to each 1 bit in the mask is set to the value of */
/* the correspnding bit in newstatus) */
/* the corresponding bit in newstatus) */
/* returns context */
/* */
/* No error is possible. */
Expand Down
2 changes: 1 addition & 1 deletion src/decNumber/decNumber.c
Original file line number Diff line number Diff line change
Expand Up @@ -8097,7 +8097,7 @@ static void *decMalloc(size_t n) {
uInt uiwork; // for macros

alloc=malloc(size); // -> allocated storage
if (alloc==NULL) return NULL; // out of strorage
if (alloc==NULL) return NULL; // out of storage
b0=(uByte *)alloc; // as bytes
decAllocBytes+=n; // account for storage
UBFROMUI(alloc, n); // save n
Expand Down
2 changes: 1 addition & 1 deletion src/decNumber/decNumberLocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@


/* ---------------------------------------------------------------- */
/* Definitions for arbitary-precision modules (only valid after */
/* Definitions for arbitrary-precision modules (only valid after */
/* decNumber.h has been included) */
/* ---------------------------------------------------------------- */

Expand Down
10 changes: 5 additions & 5 deletions src/jv.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ enum {
#define JVP_FLAGS_NUMBER_LITERAL JVP_MAKE_FLAGS(JV_KIND_NUMBER, JVP_MAKE_PFLAGS(JVP_NUMBER_DECIMAL, 1))

// the decimal precision of binary double
#define DEC_NUBMER_DOUBLE_PRECISION (17)
#define DEC_NUMBER_DOUBLE_PRECISION (17)
#define DEC_NUMBER_STRING_GUARD (14)
#define DEC_NUBMER_DOUBLE_EXTRA_UNITS ((DEC_NUBMER_DOUBLE_PRECISION - DECNUMDIGITS + DECDPUN - 1)/DECDPUN)
#define DEC_NUMBER_DOUBLE_EXTRA_UNITS ((DEC_NUMBER_DOUBLE_PRECISION - DECNUMDIGITS + DECDPUN - 1)/DECDPUN)

#include "jv_thread.h"
#ifdef WIN32
Expand Down Expand Up @@ -542,7 +542,7 @@ typedef struct {

typedef struct {
decNumber number;
decNumberUnit units[DEC_NUBMER_DOUBLE_EXTRA_UNITS];
decNumberUnit units[DEC_NUMBER_DOUBLE_EXTRA_UNITS];
} decNumberDoublePrecision;


Expand Down Expand Up @@ -600,11 +600,11 @@ static double jvp_literal_number_to_double(jv j) {

// init as decimal64 but change digits to allow conversion to binary64 (double)
decContextDefault(&dblCtx, DEC_INIT_DECIMAL64);
dblCtx.digits = DEC_NUBMER_DOUBLE_PRECISION;
dblCtx.digits = DEC_NUMBER_DOUBLE_PRECISION;

decNumber *p_dec_number = jvp_dec_number_ptr(j);
decNumberDoublePrecision dec_double;
char literal[DEC_NUBMER_DOUBLE_PRECISION + DEC_NUMBER_STRING_GUARD + 1];
char literal[DEC_NUMBER_DOUBLE_PRECISION + DEC_NUMBER_STRING_GUARD + 1];

// reduce the number to the shortest possible form
// that fits into the 64 bit floating point representation
Expand Down
Loading