Commit 80bc904b authored by Michael Reeves's avatar Michael Reeves

Strip c style struct keyword

C++ does not require struct when referancing a defined type.
parent 359f31b3
......@@ -93,7 +93,7 @@ struct partition {
It cannot cause incorrect diff output. */
GNULineRef GnuDiff::diag(GNULineRef xoff, GNULineRef xlim, GNULineRef yoff, GNULineRef ylim, bool find_minimal,
struct partition *part)
partition *part)
{
GNULineRef *const fd = fdiag; /* Give the compiler a chance. */
GNULineRef *const bd = bdiag; /* Additional help for the compiler. */
......@@ -348,7 +348,7 @@ void GnuDiff::compareseq(GNULineRef xoff, GNULineRef xlim, GNULineRef yoff, GNUL
else
{
GNULineRef c;
struct partition part;
partition part;
/* Find a point of correspondence in the middle of the files. */
......@@ -391,7 +391,7 @@ void GnuDiff::compareseq(GNULineRef xoff, GNULineRef xlim, GNULineRef yoff, GNUL
When we discard a line, we also mark it as a deletion or insertion
so that it will be printed in the output. */
void GnuDiff::discard_confusing_lines(struct file_data filevec[])
void GnuDiff::discard_confusing_lines(file_data filevec[])
{
int f;
GNULineRef i;
......@@ -599,7 +599,7 @@ void GnuDiff::discard_confusing_lines(struct file_data filevec[])
but usually it is cleaner to consider the following identical line
to be the "change". */
void GnuDiff::shift_boundaries(struct file_data filevec[])
void GnuDiff::shift_boundaries(file_data filevec[])
{
int f;
......@@ -717,7 +717,7 @@ GnuDiff::change *GnuDiff::add_change(GNULineRef line0, GNULineRef line1, GNULine
/* Scan the tables of which lines are inserted and deleted,
producing an edit script in reverse order. */
GnuDiff::change *GnuDiff::build_reverse_script(struct file_data const filevec[])
GnuDiff::change *GnuDiff::build_reverse_script(file_data const filevec[])
{
change *script = nullptr;
bool *changed0 = filevec[0].changed;
......@@ -753,7 +753,7 @@ GnuDiff::change *GnuDiff::build_reverse_script(struct file_data const filevec[])
/* Scan the tables of which lines are inserted and deleted,
producing an edit script in forward order. */
GnuDiff::change *GnuDiff::build_script(struct file_data const filevec[])
GnuDiff::change *GnuDiff::build_script(file_data const filevec[])
{
change *script = nullptr;
bool *changed0 = filevec[0].changed;
......@@ -784,7 +784,7 @@ GnuDiff::change *GnuDiff::build_script(struct file_data const filevec[])
}
/* Report the differences of two files. */
GnuDiff::change *GnuDiff::diff_2_files(struct comparison *cmp)
GnuDiff::change *GnuDiff::diff_2_files(comparison *cmp)
{
GNULineRef diags;
int f;
......
......@@ -108,7 +108,7 @@ class GnuDiff
which the insertion was done; vice versa for INSERTED and LINE1. */
struct change {
struct change *link; /* Previous or next edit command */
change *link; /* Previous or next edit command */
GNULineRef inserted; /* # lines of file 1 changed here. */
GNULineRef deleted; /* # lines of file 0 changed here. */
GNULineRef line0; /* Line number of 1st deleted line. */
......@@ -182,20 +182,20 @@ class GnuDiff
/* Data on two input files being compared. */
struct comparison {
struct file_data file[2];
struct comparison const *parent; /* parent, if a recursive comparison */
file_data file[2];
comparison const *parent; /* parent, if a recursive comparison */
};
/* Describe the two files currently being compared. */
struct file_data files[2];
file_data files[2];
/* Declare various functions. */
/* analyze.c */
struct change *diff_2_files(struct comparison *);
change *diff_2_files(comparison *);
/* io.c */
bool read_files(struct file_data[], bool);
bool read_files(file_data[], bool);
/* util.c */
bool lines_differ(const QChar *, size_t, const QChar *, size_t);
......@@ -205,15 +205,15 @@ class GnuDiff
// gnudiff_analyze.cpp
GNULineRef diag(GNULineRef xoff, GNULineRef xlim, GNULineRef yoff, GNULineRef ylim, bool find_minimal, struct partition *part);
void compareseq(GNULineRef xoff, GNULineRef xlim, GNULineRef yoff, GNULineRef ylim, bool find_minimal);
void discard_confusing_lines(struct file_data filevec[]);
void shift_boundaries(struct file_data filevec[]);
struct change *add_change(GNULineRef line0, GNULineRef line1, GNULineRef deleted, GNULineRef inserted, struct change *old);
struct change *build_reverse_script(struct file_data const filevec[]);
struct change *build_script(struct file_data const filevec[]);
void discard_confusing_lines(file_data filevec[]);
void shift_boundaries(file_data filevec[]);
change *add_change(GNULineRef line0, GNULineRef line1, GNULineRef deleted, GNULineRef inserted, change *old);
change *build_reverse_script(file_data const filevec[]);
change *build_script(file_data const filevec[]);
// gnudiff_io.cpp
void find_and_hash_each_line(struct file_data *current);
void find_identical_ends(struct file_data filevec[]);
void find_and_hash_each_line(file_data *current);
void find_identical_ends(file_data filevec[]);
// gnudiff_xmalloc.cpp
void *xmalloc(size_t n);
......
......@@ -56,7 +56,7 @@ static size_t nbuckets;
/* Array in which the equivalence classes are allocated.
The bucket-chains go through the elements in this array.
The number of an equivalence class is its index in this array. */
static struct equivclass *equivs;
static equivclass *equivs;
/* Index of first free element in the array `equivs'. */
static GNULineRef equivs_index;
......@@ -129,7 +129,7 @@ bool GnuDiff::lines_differ(const QChar *s1, size_t len1, const QChar *s2, size_t
/* Split the file into lines, simultaneously computing the equivalence
class for each line. */
void GnuDiff::find_and_hash_each_line(struct file_data *current)
void GnuDiff::find_and_hash_each_line(file_data *current)
{
hash_value h;
const QChar *p = current->prefix_end;
......@@ -143,7 +143,7 @@ void GnuDiff::find_and_hash_each_line(struct file_data *current)
GNULineRef line = 0;
GNULineRef linbuf_base = current->linbuf_base;
GNULineRef *cureqs = (GNULineRef *)xmalloc(alloc_lines * sizeof *cureqs);
struct equivclass *eqs = equivs;
equivclass *eqs = equivs;
GNULineRef eqs_index = equivs_index;
GNULineRef eqs_alloc = equivs_alloc;
const QChar *suffix_begin = current->suffix_begin;
......@@ -322,7 +322,7 @@ guess_lines(GNULineRef n, size_t s, size_t t)
/* Given a vector of two file_data objects, find the identical
prefixes and suffixes of each object. */
void GnuDiff::find_identical_ends(struct file_data filevec[])
void GnuDiff::find_identical_ends(file_data filevec[])
{
/* Find identical prefix. */
const QChar *p0, *p1, *buffer0, *buffer1;
......@@ -508,7 +508,7 @@ static_assert(sizeof(size_t) * CHAR_BIT <= sizeof prime_offset, "Not enough prim
Return nonzero if either file appears to be a binary file.
If PRETEND_BINARY is nonzero, pretend they are binary regardless. */
bool GnuDiff::read_files(struct file_data filevec[], bool /*pretend_binary*/)
bool GnuDiff::read_files(file_data filevec[], bool /*pretend_binary*/)
{
GNULineRef i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment