/trunk/filer/auto_buffer.cc |
---|
3,10 → 3,12 |
// Redistribution and modification are permitted under the terms of the |
// GNU General Public License (version 2 or any later version). |
#include <new> |
#include "auto_buffer.h" |
auto_buffer::auto_buffer(size_type size): |
_buffer(new char[size]) |
_buffer(new(std::nothrow) char[size]) |
{} |
auto_buffer& auto_buffer::operator=(auto_buffer& buffer) |
/trunk/filer/directory.cc |
---|
4,6 → 4,7 |
// GNU General Public License (version 2 or any later version). |
#include <cstring> |
#include <new> |
#include "oslib/osfscontrol.h" |
44,7 → 45,7 |
if (capacity>_capacity) |
{ |
// Allocate new, larger array. |
value_type* new_values=new value_type[capacity]; |
value_type* new_values=new(std::nothrow) value_type[capacity]; |
value_type* old_values=_values; |
// Copy values from old array to new array. |
218,7 → 219,8 |
{ |
// If the leafname is not already present then create |
// a new entry and insert it into the directory. |
value_type info((osgbpb_info*)new int[info_words]); |
value_type info( |
(osgbpb_info*)new(std::nothrow) int[info_words]); |
*info=*info_src; |
strcpy(info->name,info_src->name); |
insert(info,f); |
/trunk/filer/pathname_table.cc |
---|
5,6 → 5,7 |
#include <cstring> |
#include <cstdio> |
#include <new> |
#include "oslib/os.h" |
#include "oslib/osfscontrol.h" |
75,7 → 76,7 |
{ |
// Reallocate index data (without allowing the existing index |
// to become invalid until it is no longer needed). |
int* new_index_data=new int[capacity]; |
int* new_index_data=new(std::nothrow) int[capacity]; |
for (unsigned int i=0;i!=_size;++i) |
{ |
new_index_data[i]=_index_data[i]; |
87,7 → 88,8 |
// Reallocate index node pointers (again, without allowing the |
// existing node pointers to become invalid until they are no |
// longer needed). |
volatile node** new_index_nodes=new volatile node*[capacity]; |
volatile node** new_index_nodes= |
new(std::nothrow) volatile node*[capacity]; |
for (unsigned int i=0;i!=_size;++i) |
{ |
new_index_nodes[i]=_index_nodes[i]; |
99,7 → 101,7 |
// Create new nodes. |
while (_capacity<capacity) |
{ |
node* n=new node; |
node* n=new(std::nothrow) node; |
n->next=_free.next; |
_free.next=n; |
++_capacity; |
/trunk/filer/main.cc |
---|
3,6 → 3,8 |
// Redistribution and modification are permitted under the terms of the |
// GNU General Public License (version 2 or any later version). |
#include <new> |
#include "header.h" |
#include "filer_application.h" |
#include "main.h" |
24,7 → 26,7 |
{ |
if (!app) |
{ |
app=new filer_application; |
app=new(std::nothrow) filer_application; |
app->run(&pollword); |
delete app; |
app=0; |
/trunk/filer/Makefile |
---|
10,7 → 10,7 |
FIXDEPS = fixdeps |
CPPFLAGS = -IOSLib: |
CXXFLAGS = -mthrowback -mlibscl -mmodule \ |
CXXFLAGS = -mthrowback -mlibscl -mmodule -fno-exceptions -Os \ |
-Wall -W -Wno-unused -Wno-uninitialized -mpoke-function-name |
ASFLAGS = -throwback -objasm -module -apcs32 -apcsfpv3 -target xscale -IOSLib: |
LDFLAGS = -mlibscl -mmodule |
/trunk/filer/window_table.cc |
---|
3,13 → 3,15 |
// Redistribution and modification are permitted under the terms of the |
// GNU General Public License (version 2 or any later version). |
#include <new> |
#include "window.h" |
#include "window_table.h" |
window_table::window_table(size_type capacity): |
_size(0), |
_capacity(capacity), |
_nodes(new node[_capacity]) |
_nodes(new(std::nothrow) node[_capacity]) |
{} |
void window_table::insert(window& w) |
18,7 → 20,7 |
if (_size==_capacity) |
{ |
_capacity*=2; |
node* nodes=new node[_capacity]; |
node* nodes=new(std::nothrow) node[_capacity]; |
for (size_type i=0;i!=_size;++i) |
{ |
nodes[i]=_nodes[i]; |
/trunk/filer/header.cmhg |
---|
3,7 → 3,7 |
; Redistribution and modification are permitted under the terms of the |
; GNU General Public License (version 2 or any later version). |
title-string: Filer |
title-string: Filer2 |
help-string: Filer\t2.10 © Graham Shaw |
/trunk/filer/filer_window.cc |
---|
5,6 → 5,7 |
#include <cstring> |
#include <cstdio> |
#include <new> |
#include "oslib/osbyte.h" |
#include "oslib/osfscontrol.h" |
45,7 → 46,7 |
filer_window::filer_window(filer_application* app,const char* pathname, |
const os_box& box,const filer_options& options): |
window(app), |
_pathname(new char[std::strlen(pathname)+1]), |
_pathname(new(std::nothrow) char[std::strlen(pathname)+1]), |
_options(options), |
_directory(options.sort()), |
_xcsize(68), |
487,7 → 488,7 |
if (!_shared_menu) |
{ |
wimp_open_template(template_pathname); |
_shared_menu=new filer_menu(parent_application()); |
_shared_menu=new(std::nothrow) filer_menu(parent_application()); |
wimp_close_template(); |
} |
return *_shared_menu; |
803,8 → 804,8 |
// Open new window. |
*lastdot=0; |
new filer_window((filer_application*)parent_application(), |
_pathname,box,_options); |
new(std::nothrow) filer_window( |
(filer_application*)parent_application(),_pathname,box,_options); |
*lastdot='.'; |
} |
} |
864,7 → 865,7 |
if (std::strlen(_pathname)+std::strlen(info.name)+1<max_name_length) |
{ |
std::sprintf(buffer,"%s.%s",_pathname,info.name); |
window* w=new filer_window( |
window* w=new(std::nothrow) filer_window( |
(filer_application*)parent_application(), |
buffer,box,_options); |
} |
/trunk/filer/menu.cc |
---|
4,6 → 4,7 |
// GNU General Public License (version 2 or any later version). |
#include <cstring> |
#include <new> |
#include "menu_item.h" |
#include "menu.h" |
14,7 → 15,8 |
_data(0) |
{ |
// Allocate data block. |
_data=(wimp_menu*)new char[sizeof(wimp_menu)+size*sizeof(wimp_menu_entry)]; |
_data=(wimp_menu*)new(std::nothrow) |
char[sizeof(wimp_menu)+size*sizeof(wimp_menu_entry)]; |
// Initialise menu header. |
std::strcpy(_data->title_data.text,title); |
/trunk/filer/filer_application.cc |
---|
3,6 → 3,8 |
// Redistribution and modification are permitted under the terms of the |
// GNU General Public License (version 2 or any later version). |
#include <new> |
#include "oslib/os.h" |
#include "oslib/wimp.h" |
94,7 → 96,8 |
box.y1=pos.y; |
// Open new filer window. |
new filer_window(this,message.dir_name,box,get_default_options()); |
new(std::nothrow) filer_window( |
this,message.dir_name,box,get_default_options()); |
} |
void filer_application::handle_mode_change() |
/trunk/filer/filer_menu.cc |
---|
5,6 → 5,7 |
#include <cstring> |
#include <cstdio> |
#include <new> |
#include "oslib/fileraction.h" |
#include "oslib/osfscontrol.h" |
38,11 → 39,11 |
_rename_leafname(0), |
_find_pattern(0), |
_filetype_field(0), |
_selection_text(new char[12+max_name_length]), |
_selection_text(new(std::nothrow) char[12+max_name_length]), |
_layout_count(3), |
_layout_methods(new layout_method*[_layout_count]), |
_layout_methods(new(std::nothrow) layout_method*[_layout_count]), |
_sort_count(4), |
_sort_methods(new sort_method*[_sort_count]) |
_sort_methods(new(std::nothrow) sort_method*[_sort_count]) |
{ |
_layout_methods[0]=&filer_options::layout_large(); |
_layout_methods[1]=&filer_options::layout_small(); |
63,7 → 64,7 |
_display_menu[7].text("Sort by date"); |
_display_menu[3].separator(1); |
_rename_leafname=new char[256]; |
_rename_leafname=new(std::nothrow) char[256]; |
_rename_leafname[0]=0; |
_rename_menu[0].text(_rename_leafname,256); |
_rename_menu[0].writable(1); |
77,12 → 78,12 |
_access_menu[1].separator(1); |
_access_menu[3].separator(1); |
_find_pattern=new char[256]; |
_find_pattern=new(std::nothrow) char[256]; |
_find_pattern[0]=0; |
_find_menu[0].text(_find_pattern,256); |
_find_menu[0].writable(1); |
_filetype_field=new char[16]; |
_filetype_field=new(std::nothrow) char[16]; |
_filetype_field[0]=0; |
_filetype_menu[0].text(_filetype_field,16); |
_filetype_menu[0].writable(1); |
/trunk/filer/rtl.cc |
---|
New file |
0,0 → 1,17 |
// This file is part of the free Filer module for RISC OS. |
// Copyright © 2007 Graham Shaw. |
// Redistribution and modification are permitted under the terms of the |
// GNU General Public License (version 2 or any later version). |
#include <csignal> |
/** Attempt to execute pure virtual function. |
* If the normal RTL is allowed to handle this then it will attempt to |
* throw an exception, which will pull in all the exception handling code. |
* Instead, throw a SIGSEGV. |
*/ |
extern "C" |
void __cxa_pure_virtual() |
{ |
std::raise(SIGSEGV); |
} |
/trunk/filer/new.cc |
---|
7,7 → 7,7 |
#include "oslib/osmodule.h" |
void* operator new(size_t size) |
void* operator new(size_t size,const std::nothrow_t&) |
{ |
return osmodule_alloc(size); |
} |
17,7 → 17,7 |
osmodule_free(block); |
} |
void* operator new[](size_t size) |
void* operator new[](size_t size,const std::nothrow_t&) |
{ |
return osmodule_alloc(size); |
} |