Fix warnings on FreeBSD

This commit is contained in:
Ulrich Wilkens
2018-06-01 03:55:10 +02:00
committed by Jon Trulson
parent 885b65a09a
commit 297b6bd845
65 changed files with 342 additions and 269 deletions

View File

@@ -63,7 +63,7 @@ const char* loutFeatureProcessor::convertToLiteral(const char* str)
if ( literalBufferSize < 2*size + 3 ) {
literalBufferSize = 2*size + 3;
literalBufferSize *= 2;
delete literalBuffer;
delete [] literalBuffer;
literalBuffer = new char[literalBufferSize];
}

View File

@@ -47,7 +47,7 @@ static ostrstream& terminate(ostrstream& ost)
#endif
DocParser::DocParser(Resolver &r)
: f_resolver(r), f_ignoring_element(0),
: f_ignoring_element(0), f_resolver(r),
#if defined(SC3)
f_buffer(new char[DATA_BUF_SIZ]),
f_output(f_buffer, DATA_BUF_SIZ)

View File

@@ -22,6 +22,7 @@
*/
// $TOG: defParser.C /main/5 1997/12/23 11:16:25 bill $
#ifndef lint
__attribute__((unused))
static const char defParsersccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
#endif
#define defParserBYACC 1

View File

@@ -235,7 +235,7 @@ void addToDefTokenStringBuf(const unsigned char* str, int size)
defToken_string_buf_size = 2*(size+defToken_string_buf_content_size);
unsigned char* x = new unsigned char[defToken_string_buf_size];
memcpy(x, defToken_string_buf, defToken_string_buf_content_size);
delete defToken_string_buf;
delete [] defToken_string_buf;
defToken_string_buf = x;
}

View File

@@ -51,7 +51,7 @@ void addToDefTokenStringBuf(const unsigned char* str, int size)
defToken_string_buf_size = 2*(size+defToken_string_buf_content_size);
unsigned char* x = new unsigned char[defToken_string_buf_size];
memcpy(x, defToken_string_buf, defToken_string_buf_content_size);
delete defToken_string_buf;
delete [] defToken_string_buf;
defToken_string_buf = x;
}

View File

@@ -22,6 +22,7 @@
*/
// $TOG: style.C /main/6 1998/04/17 11:51:49 mgreess $
#ifndef lint
__attribute__((unused))
static const char stylesccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
#endif
#define styleBYACC 1

View File

@@ -263,7 +263,7 @@ void addToQstringBuf(const unsigned char* str, int size)
qstring_buf_size = 2*(size+qstring_buf_content_size);
unsigned char* x = new unsigned char[qstring_buf_size];
memcpy(x, qstring_buf, qstring_buf_content_size);
delete qstring_buf;
delete [] qstring_buf;
qstring_buf = x;
}
@@ -699,7 +699,7 @@ case 2:
# line 99 "tokenStyle.l"
{
if ( commentBufferSize < styleleng ) {
delete commentBuffer;
delete [] commentBuffer;
commentBufferSize = 2 * styleleng ;
commentBuffer = new char [commentBufferSize];
}

View File

@@ -77,7 +77,7 @@ void addToQstringBuf(const unsigned char* str, int size)
qstring_buf_size = 2*(size+qstring_buf_content_size);
unsigned char* x = new unsigned char[qstring_buf_size];
memcpy(x, qstring_buf, qstring_buf_content_size);
delete qstring_buf;
delete [] qstring_buf;
qstring_buf = x;
}
@@ -98,7 +98,7 @@ unit ([Ii][Nn]|[Ii][Nn][Cc][Hh]|[Pp][Cc]|[Pp][Ii][Cc][Aa]|[Pp][Tt]|[Pp][Oo][Ii][
^"#".* {
if ( commentBufferSize < yyleng ) {
delete commentBuffer;
delete [] commentBuffer;
commentBufferSize = 2 * yyleng ;
commentBuffer = new char [commentBufferSize];
}

View File

@@ -51,7 +51,7 @@
#include "compression/code.h"
encoding_unit::encoding_unit(ostring* w, unsigned int f) :
word(w), freq(f), code(0), bits(0), leaf_htr_node(NULL)
word(w), bits(0), freq(f), code(0), leaf_htr_node(NULL)
{
}

View File

@@ -40,7 +40,7 @@ char *Exception::g_next_avail = Exception::g_temp_space;
// /////////////////////////////////////////////////////////////////
Exception::Exception()
: f_thrown(0), f_thrown_as_pointer(1), f_temporary(0), f_line(0), f_file(NULL), f_previous_exception(NULL)
: f_thrown(0), f_thrown_as_pointer(1), f_temporary(0), f_file(NULL), f_line(0), f_previous_exception(NULL)
{
PRINTF (("Constructed Exception obj @ %p\n", this));
}

View File

@@ -439,7 +439,7 @@ io_status oid_list::asciiIn(istream& in)
list_ptr.p -> set(oid_array, v_sz);
}
delete oid_array;
delete [] oid_array;
return done;
}

View File

@@ -22,6 +22,7 @@
*/
// $TOG: sheet.C /main/4 1997/12/23 11:20:35 bill $
#ifndef lint
__attribute__((unused))
static const char schemasccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
#endif
#define schemaBYACC 1

View File

@@ -57,9 +57,9 @@ public:
BookmarkEdit (UAS_Pointer<Mark> &mark)
: f_mark_ptr (mark),
f_shell (NULL),
f_modified (FALSE),
f_name_text(NULL),
f_notes_text(NULL),
f_modified (FALSE),
f_wm_delete_callback(NULL)
{
MarkMgr::request ((UAS_Receiver<MarkMoved> *) this);

View File

@@ -118,15 +118,15 @@ GraphicAgent::GraphicAgent (UAS_Pointer<UAS_Common> &node_ptr,
: f_shell (NULL),
f_node_ptr(node_ptr),
f_graphic (gr),
f_panner_state (PANNER_NONE),
f_current_scale (100),
f_scale_button(NULL),
f_setcustom(0),
f_panner(NULL),
f_pixmap_widget(NULL),
f_panner_state (PANNER_NONE),
f_current_scale (100),
f_view_menu(NULL),
f_message_area(NULL),
f_custom_scale(NULL)
f_scale_button(NULL),
f_custom_scale(NULL),
f_setcustom(0)
{
f_graphic->pixmap_graphic()->agent(this);

View File

@@ -152,14 +152,13 @@ private: // variables
inline
LibraryAgent::LibraryAgent()
: f_shell (NULL),
f_doc_tree_view(),
f_oe (NULL),
f_keep_forever (FALSE),
f_wm_delete_callback (NULL),
f_tracking_hierarchy (NULL),
f_popped_down (TRUE),
f_close (NULL),
f_close_sensitive (FALSE),
f_doc_tree_view(),
f_copy(NULL),
f_detach(NULL),
f_detach2(NULL),
@@ -171,6 +170,7 @@ LibraryAgent::LibraryAgent()
f_remove(NULL),
f_remove2(NULL),
f_auto_track(NULL),
f_close_sensitive (FALSE),
f_status_text(NULL),
f_scope_menu(NULL)

View File

@@ -219,15 +219,15 @@ MapButton::destroy()
// /////////////////////////////////////////////////////////////////
MapAgent::MapAgent()
: f_shell (NULL),
f_onscreen (FALSE),
f_locked(FALSE),
: f_locked(FALSE),
f_map_mode(LOCAL_MODE),
f_shell (NULL),
f_porthole(NULL),
f_panner(NULL),
f_tree(NULL),
f_wm_delete_callback(NULL),
f_lock(NULL),
f_onscreen (FALSE),
f_min_tree_width(0),
f_min_tree_height(0)
{

View File

@@ -84,8 +84,8 @@
MarkChooser::MarkChooser (Widget parent, xList<MarkCanvas *> &marks,
const char *title_key, const char *ok_key)
: f_selected_item (-1),
f_mark_list (&marks),
f_done(FALSE)
f_done(FALSE),
f_mark_list (&marks)
{
create_ui (parent, title_key, ok_key);
update_list();

View File

@@ -81,9 +81,9 @@
// /////////////////////////////////////////////////////////////////
MarkListView::MarkListView()
: f_shell (NULL),
f_popped_up (FALSE),
f_selected_item(0)
: f_selected_item(0),
f_shell (NULL),
f_popped_up (FALSE)
{
}

View File

@@ -94,8 +94,8 @@ private: // variables
inline
MessageAgent::MessageAgent()
: f_dialog (NULL),
f_exit_flag (False),
f_text(NULL),
f_exit_flag (False),
f_real_parent(NULL),
f_popped_up(FALSE),
f_pressed_ok(FALSE)

View File

@@ -778,16 +778,6 @@ NodeWindowAgent::NodeWindowAgent (u_int serial_no)
f_shell (NULL),
f_help_dsp_area (NULL),
f_close(NULL),
f_current_ancestor (NULL),
f_form(NULL),
f_preview_timeout (NULL),
f_serial_number(serial_no),
f_history_display (FALSE),
f_vscrollbar_offset(0),
f_hscrollbar_offset(0),
f_graphic_segment(NULL),
f_graphics_handler(NULL),
f_close_sensitive(FALSE),
f_frame(NULL),
f_create_bmrk(NULL),
f_create_anno(NULL),
@@ -810,10 +800,20 @@ NodeWindowAgent::NodeWindowAgent (u_int serial_no)
f_print(NULL),
f_print2(NULL),
f_print_as(NULL),
f_current_ancestor (NULL),
f_form(NULL),
f_move_mark_sensitive(0),
f_last_access_time(0),
f_locked(FALSE),
f_wm_delete_callback(NULL)
f_wm_delete_callback(NULL),
f_preview_timeout (NULL),
f_serial_number(serial_no),
f_history_display (FALSE),
f_vscrollbar_offset(0),
f_hscrollbar_offset(0),
f_graphic_segment(NULL),
f_graphics_handler(NULL),
f_close_sensitive(FALSE)
{
UAS_Common::request ((UAS_Receiver<UAS_LibraryDestroyedMsg> *) this);

View File

@@ -151,9 +151,8 @@ static Boolean print_hierarchy; // keep track of hierarchy vs section
#if 0 && defined(PRINTING_SUPPORTED)
static void PrintEverything(AppPrintData *p);
#endif /* PRINTING_SUPPORTED */
static void PrintOneUASCommon(UAS_Pointer<UAS_Common> &doc, Widget pshell, int *cur_pageP);
#endif /* PRINTING_SUPPORTED */
PrintPanelAgent::PrintPanelAgent()
{
@@ -963,7 +962,6 @@ PrintEverything(AppPrintData *p)
RCS_DEBUG("PrintEverything exiting.\n");
}
#endif /* PRINTING_SUPPORTED */
static void
PrintOneUASCommon(UAS_Pointer<UAS_Common> &doc, Widget pshell, int *cur_pageP)
@@ -1030,6 +1028,7 @@ PrintOneUASCommon(UAS_Pointer<UAS_Common> &doc, Widget pshell, int *cur_pageP)
}
}
}
#endif /* PRINTING_SUPPORTED */
/*
* ------------------------------------------------------------------------

View File

@@ -115,9 +115,9 @@ protected: // variables
inline
SearchResultsAgent::SearchResultsAgent()
: f_work_proc_id (0), f_popped_up(FALSE), f_my_ale(NULL), f_retain(FALSE),
f_results(NULL), f_selected_item(0), f_retain_toggle(NULL), f_query_text(NULL),
f_hits_label(NULL), f_scope_label(NULL), f_docs_to_display(0), f_count(0),
f_scale(0), f_header_indent(0)
: f_my_ale(NULL), f_retain(FALSE), f_results(NULL), f_selected_item(0),
f_retain_toggle(NULL), f_query_text(NULL), f_hits_label(NULL),
f_scope_label(NULL), f_docs_to_display(0), f_count(0), f_scale(0),
f_work_proc_id(0), f_popped_up(FALSE), f_header_indent(0)
{
}

View File

@@ -75,8 +75,8 @@ public:
void write (const int integer);
void write (const size_t integer)
{ write ((size_t) ((void *) integer)); }
void write (const unsigned int integer)
{ write ((int) (integer)); }
void write (const char *string);
void write (const char *bytes, u_int size, u_int length);

View File

@@ -121,8 +121,6 @@ List::append (FolioObject &element)
check_space();
/* -------- Add the element. -------- */
if (&element == NULL)
abort();
f_list_element[f_length] = &element;
f_length++;
notify (APPENDED, (void *)(size_t) (f_length - 1));

View File

@@ -429,7 +429,7 @@ olias_send_event (Widget, OliasEvent *event)
if (locator == NULL)
return (OLIAS_TIMEOUT);
ON_DEBUG(printf(">>> g_top_locator = %p\n", g_top_locator));
if (g_top_locator == NULL)
if (g_top_locator[0] == '\0')
return (OLIAS_TIMEOUT);
g_scroll_to_locator = TRUE;
len = MIN(strlen(locator), 4096 - 1);

View File

@@ -231,16 +231,16 @@ print_justify (unsigned value)
CanvasRenderer::CanvasRenderer(int font_scale)
: Renderer(),
f_vcc(0),
f_current_container(NULL),
f_current_displayable(NULL),
f_current_tgroup (0),
f_font (0),
f_link_idx (-1),
f_font_scale(font_scale),
f_default_features(NULL),
fBogusSymbol(gElemSymTab->intern("%BOGUS")),
f_level(0),
f_vcc(0),
f_current_container(NULL),
f_current_displayable(NULL),
f_default_features(NULL)
f_level(0)
{
// make symbols
for ( int i=0; i < REND_SYMBOLS; i++)
@@ -2534,7 +2534,7 @@ TGDefn::build()
delete grid[r] ; // clean up column memory
}
delete grid ;
delete [] grid ;
// now apply the formats to the _DtCvTable
{

View File

@@ -226,8 +226,8 @@ public:
Shell_Info (Widget w)
: f_shell (w),
f_size_hints (NULL),
f_restore (False),
f_has_size_hints(False),
f_restore (False),
f_iconic(False),
f_has_wm_state(False)
{ }
@@ -247,22 +247,22 @@ public:
// /////////////////////////////////////////////////////////////////
WindowSystem::WindowSystem (int &argc, char *argv[])
: f_printing(False),
: f_print_display(NULL),
f_printing(False),
f_default_pixmap (0),
f_default_print_pixmap(0),
f_defpix_width (0),
f_defpix_height (0),
f_detached_pixmap(0),
f_shell_list (20),
f_cursor_stack_pos(-1),
f_dtinfo_font(NULL),
f_dtinfo_space_font(NULL),
f_print_display(NULL),
f_default_print_pixmap(0),
f_print_defpix_width(0),
f_print_defpix_height(0),
f_detached_pixmap(0),
f_detached_width(0),
f_detached_height(0),
f_print_screen(NULL)
f_shell_list (20),
f_cursor_stack_pos(-1),
f_print_screen(NULL),
f_dtinfo_font(NULL),
f_dtinfo_space_font(NULL)
{
f_argc = &argc;
f_argv = argv;

View File

@@ -105,8 +105,8 @@ QueryEditor::QueryEditor(UAS_SearchEngine& search_engine)
: f_query (NULL),
f_query_view (NULL),
f_shell (NULL),
f_null_terms (0),
f_min_term_width(0)
f_min_term_width(0),
f_null_terms (0)
{
f_query_editor = this;

View File

@@ -60,12 +60,14 @@ using namespace std;
#include "dbug.h" /* ala Fred Fish's dbug package from uunet */
#endif
#ifdef LICENSE_MANAGEMENT
const int A_FEATURE = OLAF::Feature;
const int A_VEN_CODE = OLAF::VenCode;
const int A_VERSION = OLAF::Version;
const int A_GROUPING = OLAF::Grouping;
const int A_DEMO_TERMS = OLAF::DemoTerms;
const int A_DEFAULT_SECTION = OLAF::DefaultSection;
#endif
/***********************************
*

View File

@@ -22,6 +22,7 @@
*/
/* $TOG: OL_DataExpr.C /main/4 1997/12/23 11:38:27 bill $ */
#ifndef lint
__attribute__((unused))
static const char ol_datasccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/90";
#endif
#define ol_dataBYACC 1

View File

@@ -37,7 +37,7 @@
#include <string.h>
#include <errno.h>
#include <unistd.h>
# include <libgen.h> /* for dirname() */
#include <libgen.h> /* for dirname() */
#include <ctype.h>
#include <signal.h>
#if !defined(CSRG_BASED)
@@ -235,7 +235,7 @@ static char *buildSpec(void);
static void defaultGlobals(void);
static void checkGlobals(void);
static int parseArgs(int argc, char *argv[]);
static char *parseDocument(Boolean runCmd, ...);
static char *parseDocument(int runCmd, ...);
static void buildBookcase(char *cmdSrc, char *dirName);
static char *storeBookCase(char *cmdSrc, char *tocOpt, char *dbName,
char *dirName);
@@ -1355,7 +1355,7 @@ parseArgs(int argc, char *argv[])
}
static char *
parseDocument(Boolean runCmd, ...)
parseDocument(int runCmd, ...)
{
va_list ap;
char *ptr;