Skip to content

Commit

Permalink
Merge pull request #1517 from stweil/typos
Browse files Browse the repository at this point in the history
Fix some typos (found by `codespell` and `typos`)
  • Loading branch information
rouault authored Feb 28, 2024
2 parents 7a2773d + 20ad29f commit 1b72e85
Show file tree
Hide file tree
Showing 24 changed files with 48 additions and 48 deletions.
4 changes: 2 additions & 2 deletions doc/man/man3/libopenjp2.3
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ typedef struct opj_cparameters
\fBchar\fR infile[OPJ_PATH_LEN];
/* output file name */
\fBchar\fR outfile[OPJ_PATH_LEN];
/* DEPRECATED. Index generation is now handeld with the
/* DEPRECATED. Index generation is now handled with the
opj_encode_with_info() function. Set to NULL */
\fBint\fR index_on;
/* DEPRECATED. Index generation is now handeld with the
/* DEPRECATED. Index generation is now handled with the
opj_encode_with_info() function. Set to NULL */
\fBchar\fR index[OPJ_PATH_LEN];
/* subimage encoding: origin image offset in x direction */
Expand Down
4 changes: 2 additions & 2 deletions src/bin/jp2/convertbmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ static OPJ_BOOL bmp_read_rle8_data(FILE* IN, OPJ_UINT8* pData,
}/* while() */

if (written != width * height) {
fprintf(stderr, "warning, image's actual size does not match advertized one\n");
fprintf(stderr, "warning, image's actual size does not match advertised one\n");
return OPJ_FALSE;
}

Expand Down Expand Up @@ -693,7 +693,7 @@ static OPJ_BOOL bmp_read_rle4_data(FILE* IN, OPJ_UINT8* pData,
}
} /* while(y < height) */
if (written != width * height) {
fprintf(stderr, "warning, image's actual size does not match advertized one\n");
fprintf(stderr, "warning, image's actual size does not match advertised one\n");
return OPJ_FALSE;
}
return OPJ_TRUE;
Expand Down
2 changes: 1 addition & 1 deletion src/bin/jp2/opj_compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,7 @@ static int parse_cmdline_encoder(int argc, char **argv,
/* ----------------------------------------------------- */


case 'r': { /* rates rates/distorsion */
case 'r': { /* rates rates/distortion */
char *s = opj_optarg;
parameters->tcp_numlayers = 0;
while (sscanf(s, "%f", &parameters->tcp_rates[parameters->tcp_numlayers]) ==
Expand Down
2 changes: 1 addition & 1 deletion src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ jpeg2000_file_parse(wxInputStream& stream, unsigned long int filepoint,
return (0);
}

// search first contiguos codestream box in an mj2 file
// search first contiguous codestream box in an mj2 file
unsigned long int
searchjpeg2000c(wxInputStream& stream, unsigned long int fsize, int number)
{
Expand Down
4 changes: 2 additions & 2 deletions src/bin/wx/OPJViewer/source/wxj2kparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
);

if (cbstyle & 0x04)
text = wxT("Termination on each coding passs");
text = wxT("Termination on each coding pass");
else
text = wxT("No termination on each coding pass");
subcurrid4 = m_tree->AppendItem(subcurrid3,
Expand Down Expand Up @@ -1064,7 +1064,7 @@ void OPJParseThread::ParseJ2KFile(wxFile *m_file, wxFileOffset offset, wxFileOff
);

if (cbstyle & 0x04)
text = wxT("Termination on each coding passs");
text = wxT("Termination on each coding pass");
else
text = wxT("No termination on each coding pass");
subcurrid4 = m_tree->AppendItem(subcurrid3,
Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjp2/ht_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ typedef struct frwd_struct {
* X controls this value.
*
* Unstuffing prevent sequences that are more than 0xFF7F from appearing
* in the conpressed sequence. So whenever a value of 0xFF is coded, the
* in the compressed sequence. So whenever a value of 0xFF is coded, the
* MSB of the next byte is set 0 and must be ignored during decoding.
*
* Reading can go beyond the end of buffer by up to 3 bytes.
Expand Down Expand Up @@ -1032,7 +1032,7 @@ OPJ_UINT32 frwd_fetch(frwd_struct_t *msp)
//************************************************************************/
/** @brief Allocates T1 buffers
*
* @param [in, out] t1 is codeblock cofficients storage
* @param [in, out] t1 is codeblock coefficients storage
* @param [in] w is codeblock width
* @param [in] h is codeblock height
*/
Expand Down Expand Up @@ -1120,7 +1120,7 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
/** @brief Decodes one codeblock, processing the cleanup, siginificance
* propagation, and magnitude refinement pass
*
* @param [in, out] t1 is codeblock cofficients storage
* @param [in, out] t1 is codeblock coefficients storage
* @param [in] cblk is codeblock properties
* @param [in] orient is the subband to which the codeblock belongs (not needed)
* @param [in] roishift is region of interest shift
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjp2/openjpeg.h
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ typedef struct opj_packet_info {
OPJ_OFF_T end_ph_pos;
/** packet end position */
OPJ_OFF_T end_pos;
/** packet distorsion */
/** packet distortion */
double disto;
} opj_packet_info_t;

Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjp2/opj_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef OPJ_COMMMON_H
#define OPJ_COMMMON_H
#ifndef OPJ_COMMON_H
#define OPJ_COMMON_H

/*
==========================================================
Expand All @@ -44,4 +44,4 @@
#define OPJ_COMP_PARAM_DEFAULT_PROG_ORDER OPJ_LRCP
#define OPJ_COMP_PARAM_DEFAULT_NUMRESOLUTION 6

#endif /* OPJ_COMMMON_H */
#endif /* OPJ_COMMON_H */
2 changes: 1 addition & 1 deletion src/lib/openjp2/t1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ static OPJ_BOOL opj_t1_decode_cblk(opj_t1_t *t1,
opj_mutex_lock(p_manager_mutex);
}
opj_event_msg(p_manager, EVT_WARNING,
"PTERM check failure: %d synthetized 0xFF markers read\n",
"PTERM check failure: %d synthesized 0xFF markers read\n",
mqc->end_of_byte_stream_counter);
if (p_manager_mutex) {
opj_mutex_unlock(p_manager_mutex);
Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjp2/tcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void opj_tcd_rateallocate_fixed(opj_tcd_t *tcd)
/* ----------------------------------------------------------------------- */

/** Returns OPJ_TRUE if the layer allocation is unchanged w.r.t to the previous
* invokation with a different threshold */
* invocation with a different threshold */
static
OPJ_BOOL opj_tcd_makelayer(opj_tcd_t *tcd,
OPJ_UINT32 layno,
Expand Down Expand Up @@ -2861,12 +2861,12 @@ OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
return intersects;
}

/** Returns whether a tile componenent is fully decoded, taking into account
/** Returns whether a tile component is fully decoded, taking into account
* p_tcd->win_* members.
*
* @param p_tcd TCD handle.
* @param compno Component number
* @return OPJ_TRUE whether the tile componenent is fully decoded
* @return OPJ_TRUE whether the tile component is fully decoded
*/
static OPJ_BOOL opj_tcd_is_whole_tilecomp_decoding(opj_tcd_t *p_tcd,
OPJ_UINT32 compno)
Expand Down
6 changes: 3 additions & 3 deletions src/lib/openjp2/tcd.h
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ typedef struct opj_tcd_marker_info {
/**
Dump the content of a tcd structure
*/
/*void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);*/ /* TODO MSD shoul use the new v2 structures */
/*void tcd_dump(FILE *fd, opj_tcd_t *tcd, opj_tcd_image_t *img);*/ /* TODO MSD should use the new v2 structures */

/**
Create a new TCD handle
Expand Down Expand Up @@ -443,7 +443,7 @@ OPJ_BOOL opj_tcd_update_tile_data(opj_tcd_t *p_tcd,
OPJ_SIZE_T opj_tcd_get_encoder_input_buffer_size(opj_tcd_t *p_tcd);

/**
* Initialize the tile coder and may reuse some meory.
* Initialize the tile coder and may reuse some memory.
*
* @param p_tcd TCD handle.
* @param p_tile_no current tile index to encode.
Expand Down Expand Up @@ -491,7 +491,7 @@ void opj_tcd_reinit_segment(opj_tcd_seg_t* seg);
* @param y0 Upper left y in subband coordinates
* @param x1 Lower right x in subband coordinates
* @param y1 Lower right y in subband coordinates
* @return OPJ_TRUE whether the sub-band region contributs to the area of
* @return OPJ_TRUE whether the sub-band region contributes to the area of
* interest.
*/
OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
Expand Down
4 changes: 2 additions & 2 deletions src/lib/openjpip/auxtrans_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@
typedef struct auxtrans_param {
int tcpauxport; /**< tcp port*/
int udpauxport; /**< udp port*/
SOCKET tcplistensock; /**< listenning socket for aux tcp (-1 if not open)*/
SOCKET udplistensock; /**< listenning socket for aux udp (-1 if not open)*/
SOCKET tcplistensock; /**< listening socket for aux tcp (-1 if not open)*/
SOCKET udplistensock; /**< listening socket for aux udp (-1 if not open)*/
} auxtrans_param_t;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/lib/openjpip/box_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ boxlist_param_t * get_boxstructure(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
* generate box from JP2 file at the given offset
*
* @param[in] fd file discriptor of the JP2 file
* @param[in] fd file descriptor of the JP2 file
* @param[in] offset Box offset
* @return pointer to the structure of generate box parameters
*/
Expand All @@ -91,7 +91,7 @@ box_param_t * gene_boxbyOffinStream(Byte_t *stream, OPJ_OFF_T offset);
/**
* generate(search) box from JP2 file
*
* @param[in] fd file discriptor of the JP2 file
* @param[in] fd file descriptor of the JP2 file
* @param[in] offset start Byte position of the search
* @param[in] length Byte length of the search, if 0, size to the end of file
* @param[in] TBox Box Type
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjpip/boxheader_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef struct boxheader_param {
/**
* generate a box header at the given offset
*
* @param[in] fd file discriptor of the JP2 file
* @param[in] fd file descriptor of the JP2 file
* @param[in] offset Box offset
* @return pointer to the structure of generate box header parameters
*/
Expand Down
12 changes: 6 additions & 6 deletions src/lib/openjpip/byte_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ typedef uint64_t Byte8_t;
/**
* fetch bytes of data in file stream
*
* @param[in] fd file discriptor
* @param[in] fd file descriptor
* @param[in] offset start Byte position
* @param[in] size Byte length
* @return pointer to the fetched data
Expand All @@ -53,7 +53,7 @@ Byte_t * fetch_bytes(int fd, OPJ_OFF_T offset, OPJ_SIZE_T size);
/**
* fetch a 1-byte Byte codes in file stream
*
* @param[in] fd file discriptor
* @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
Expand All @@ -62,7 +62,7 @@ Byte_t fetch_1byte(int fd, OPJ_OFF_T offset);
/**
* fetch a 2-byte big endian Byte codes in file stream
*
* @param[in] fd file discriptor
* @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
Expand All @@ -71,7 +71,7 @@ Byte2_t fetch_2bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 4-byte big endian Byte codes in file stream
*
* @param[in] fd file discriptor
* @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
Expand All @@ -80,7 +80,7 @@ Byte4_t fetch_4bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 8-byte big endian Byte codes in file stream
*
* @param[in] fd file discriptor
* @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
Expand Down Expand Up @@ -122,7 +122,7 @@ void modify_4Bytecode(Byte4_t code, Byte_t *stream);
/**
* Get file size
*
* @param[in] fd file discriptor
* @param[in] fd file descriptor
* @return file size
*/
OPJ_OFF_T get_filesize(int fd);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjpip/msgqueue_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void enqueue_metadata(Byte8_t meta_id, msgqueue_param_t *msgqueue);
* reconstruct JPT/JPP-stream from message queue
*
* @param[in] msgqueue message queue pointer
* @param[in] tmpfd file discriptor to write JPT/JPP-stream
* @param[in] tmpfd file descriptor to write JPT/JPP-stream
*/
void recons_stream_from_msgqueue(msgqueue_param_t *msgqueue, int tmpfd);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjpip/openjpip.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ typedef struct dec_server_record {
Byte_t *jpipstream; /**< JPT/JPP stream*/
OPJ_SIZE_T jpipstreamlen; /**< length of jpipstream*/
msgqueue_param_t *msgqueue; /**< parsed message queue of jpipstream*/
SOCKET listening_socket; /**< listenning socket*/
SOCKET listening_socket; /**< listening socket*/
} dec_server_record_t;


Expand Down
2 changes: 1 addition & 1 deletion src/lib/openjpip/session_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ sessionlist_param_t * gene_sessionlist(void);


/**
* generate a session under the sesion list
* generate a session under the session list
*
* @param[in] sessionlist session list to insert the new session
* @return pointer to the generated session
Expand Down
4 changes: 2 additions & 2 deletions src/lib/openjpip/sock_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ typedef int SOCKET;
SOCKET open_listeningsocket(uint16_t port);

/**
* accept a new connection to the listenning socket
* accept a new connection to the listening socket
*
* @param listening_socket listenning socket
* @param listening_socket listening socket
* @return connected socket (-1 if error occurs)
*/
SOCKET accept_socket(SOCKET listening_socket);
Expand Down
2 changes: 1 addition & 1 deletion tests/compare_images.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ int main(int argc, char **argv)
if ( imageToPNG(imageDiff, filenamePNGdiff_it_comp, it_comp) == EXIT_SUCCESS )
{
printf("<DartMeasurementFile name=\"DiffferenceImage_%d\" type=\"image/png\"> %s </DartMeasurementFile> \n", it_comp, filenamePNGdiff_it_comp);
printf("<DartMeasurementFile name=\"DifferenceImage_%d\" type=\"image/png\"> %s </DartMeasurementFile> \n", it_comp, filenamePNGdiff_it_comp);
}
*/

Expand Down
4 changes: 2 additions & 2 deletions tests/nonregression/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ set(BLACKLIST_JPEG2000
issue475.jp2 #kdu_jp2info ok
issue413.jp2 #kdu_jp2info ok
issue823.jp2 #kdu_jp2info ok
issue826.jp2 #inspection reveales that the transformation value is out of range
oss-fuzz2785.jp2 #inspection reveales that the transformation value is out of range
issue826.jp2 #inspection reveals that the transformation value is out of range
oss-fuzz2785.jp2 #inspection reveals that the transformation value is out of range
issue1438.j2k
)

Expand Down
2 changes: 1 addition & 1 deletion tests/nonregression/test_suite.ctest.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# + For encoder related tests = dump, compare dump to base, decode the encoded file with
# reference and compare the decoded file with the baseline decoded previously with
# ref decoder.
# + For decoder related tests = dump, compare dump to base, (TODO: compare outpout decoding
# + For decoder related tests = dump, compare dump to base, (TODO: compare output decoding
# image to base)
#
# Line begin with ! should failed (should be used for bad jpeg2000 file which should be
Expand Down
8 changes: 4 additions & 4 deletions tests/pdf2jp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int main(int argc, char *argv[])
{
#define NUMJP2 32
int i, c = 0;
long offets[NUMJP2];
long offsets[NUMJP2];
char buffer[512];
#define BUFLEN 4096
int cont = 1;
Expand Down Expand Up @@ -85,7 +85,7 @@ int main(int argc, char *argv[])
const ptrdiff_t diff = ret - haystack;
assert( diff >= 0 );
/*fprintf( stdout, "Found it: %lx\n", (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff);*/
offets[c++] = (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff;
offsets[c++] = (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff;
}
cont = (nread == flen);
memcpy( haystack, haystack + nread, nlen );
Expand All @@ -97,15 +97,15 @@ int main(int argc, char *argv[])
{
int s, len = 0;
char *r;
const int ret = fseek(f, offets[i], SEEK_SET);
const int ret = fseek(f, offsets[i], SEEK_SET);
assert( ret == 0 );
r = fgets(buffer, sizeof(buffer), f);
assert( r );
/*fprintf( stderr, "DEBUG: %s", r );*/
s = sscanf(r, "JPXDecode]/Length %d/Width %*d/BitsPerComponent %*d/Height %*d", &len);
if( s == 0 )
{ // try again harder
const int ret = fseek(f, offets[i] - 40, SEEK_SET); // 40 is magic number
const int ret = fseek(f, offsets[i] - 40, SEEK_SET); // 40 is magic number
assert( ret == 0 );
r = fgets(buffer, sizeof(buffer), f);
assert( r );
Expand Down
4 changes: 2 additions & 2 deletions wrapping/java/openjp2/JavaOpenJPEG.c
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ static int parse_cmdline_encoder(int argc, char **argv,
/* ----------------------------------------------------- */


case 'r': { /* rates rates/distorsion */
case 'r': { /* rates rates/distortion */
char *s = opj_optarg;
while (sscanf(s, "%f", &parameters->tcp_rates[parameters->tcp_numlayers]) ==
1) {
Expand Down Expand Up @@ -1452,7 +1452,7 @@ static char* create_index_into_byte_array(opj_codestream_info_t *cstr_info,
+ (10 /* image_w until decomposition */
+ (cstr_info->numdecompos[0] + 1) * 2 /* pdx size for each tile */
+ 2 /* main_head_end + codestream_size */
+ cstr_info->tw * cstr_info->th * 4 /* tile info, without distorsion info */
+ cstr_info->tw * cstr_info->th * 4 /* tile info, without distortion info */
+ cstr_info->tw * cstr_info->th * cstr_info->numlayers *
(cstr_info->numdecompos[0] + 1) * cstr_info->numcomps * prec_max * 8
) * sizeof(int);
Expand Down

0 comments on commit 1b72e85

Please sign in to comment.