Commit 6a553cff authored by Christian Beer's avatar Christian Beer
Browse files

Merge branch 'master' into fix_coverity_defects

parents 718f4a2b f0df42ef
......@@ -115,6 +115,8 @@ void COPROC_ATI::get(
CALuint numDevices, cal_major, cal_minor, cal_imp;
char buf[256];
int retval;
COPROC_ATI cc, cc2;
string s, gpu_name;
attribs.struct_size = sizeof(CALdeviceattribs);
numDevices =0;
......@@ -156,7 +158,7 @@ void COPROC_ATI::get(
#else
void* callib;
void* callib = NULL;
callib = dlopen("libaticalrt.so", RTLD_NOW);
if (!callib) {
......@@ -180,63 +182,61 @@ void COPROC_ATI::get(
if (!__calInit) {
warnings.push_back("calInit() missing from CAL library");
return;
goto leave;
}
if (!__calGetVersion) {
warnings.push_back("calGetVersion() missing from CAL library");
return;
goto leave;
}
if (!__calDeviceGetCount) {
warnings.push_back("calDeviceGetCount() missing from CAL library");
return;
goto leave;
}
if (!__calDeviceGetAttribs) {
warnings.push_back("calDeviceGetAttribs() missing from CAL library");
return;
goto leave;
}
if (!__calDeviceGetInfo) {
warnings.push_back("calDeviceGetInfo() missing from CAL library");
return;
goto leave;
}
retval = (*__calInit)();
if (retval != CAL_RESULT_OK) {
sprintf(buf, "calInit() returned %d", retval);
warnings.push_back(buf);
return;
goto leave;
}
retval = (*__calDeviceGetCount)(&numDevices);
if (retval != CAL_RESULT_OK) {
sprintf(buf, "calDeviceGetCount() returned %d", retval);
warnings.push_back(buf);
return;
goto leave;
}
retval = (*__calGetVersion)(&cal_major, &cal_minor, &cal_imp);
if (retval != CAL_RESULT_OK) {
sprintf(buf, "calGetVersion() returned %d", retval);
warnings.push_back(buf);
return;
goto leave;
}
if (!numDevices) {
warnings.push_back("No usable CAL devices found");
return;
goto leave;
}
COPROC_ATI cc, cc2;
string s, gpu_name;
for (CALuint i=0; i<numDevices; i++) {
retval = (*__calDeviceGetInfo)(&info, i);
if (retval != CAL_RESULT_OK) {
sprintf(buf, "calDeviceGetInfo() returned %d", retval);
warnings.push_back(buf);
return;
goto leave;
}
retval = (*__calDeviceGetAttribs)(&attribs, i);
if (retval != CAL_RESULT_OK) {
sprintf(buf, "calDeviceGetAttribs() returned %d", retval);
warnings.push_back(buf);
return;
goto leave;
}
switch ((int)attribs.target) {
case CAL_TARGET_600:
......@@ -389,9 +389,10 @@ void COPROC_ATI::get(
if (!ati_gpus.size()) {
warnings.push_back("No ATI GPUs found");
}
leave:
if (callib) dlclose(callib);
}
void COPROC_ATI::correlate(
bool use_all,
vector<int>& ignore_devs
......
......@@ -299,6 +299,7 @@ void COPROC_NVIDIA::get(
__cuMemAlloc = (int(*)(unsigned int*, size_t)) dlsym( cudalib, "cuMemAlloc" );
__cuMemFree = (int(*)(unsigned int)) dlsym( cudalib, "cuMemFree" );
__cuMemGetInfo = (int(*)(size_t*, size_t*)) dlsym( cudalib, "cuMemGetInfo" );
dlclose(cudalib);
#endif
if (!__cuDriverGetVersion) {
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
......@@ -107,13 +107,6 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID,
UpdateSelection();
#if USE_NATIVE_LISTCONTROL
m_pListPane->PushEventHandler(new MyEvtHandler(m_pListPane));
#else
m_pListPane->SaveEventHandler((m_pListPane->GetMainWin())->GetEventHandler());
(m_pListPane->GetMainWin())->PushEventHandler(new MyEvtHandler(m_pListPane));
#endif
m_iProgressColumn = -1;
m_iSortColumnID = -1;
m_bReverseSort = false;
......@@ -130,13 +123,6 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID,
CBOINCBaseView::~CBOINCBaseView() {
if (m_pListPane) {
#if USE_NATIVE_LISTCONTROL
m_pListPane->PopEventHandler(true);
#else
(m_pListPane->GetMainWin())->PopEventHandler(true);
#endif
}
if (m_SortArrows) {
delete m_SortArrows;
}
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
......@@ -87,7 +87,10 @@ CBOINCListCtrl::CBOINCListCtrl(
#if USE_NATIVE_LISTCONTROL
m_bProgressBarEventPending = false;
PushEventHandler(new MyEvtHandler(this));
#else
savedHandler = GetMainWin()->GetEventHandler();
GetMainWin()->PushEventHandler(new MyEvtHandler(this));
#ifdef __WXMAC__
SetupMacAccessibilitySupport();
#endif
......@@ -97,12 +100,16 @@ CBOINCListCtrl::CBOINCListCtrl(
CBOINCListCtrl::~CBOINCListCtrl()
{
m_iRowsNeedingProgressBars.Clear();
#if USE_NATIVE_LISTCONTROL
PopEventHandler(true);
#else
GetMainWin()->PopEventHandler(true);
#ifdef __WXMAC__
#if !USE_NATIVE_LISTCONTROL
RemoveMacAccessibilitySupport();
#endif
#endif
m_iRowsNeedingProgressBars.Clear();
}
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
......@@ -112,7 +112,6 @@ private:
bool m_bProgressBarEventPending;
#else
public:
void SaveEventHandler(wxEvtHandler *stdHandler) { savedHandler = stdHandler; }
void DrawProgressBars(void);
wxScrolledWindow* GetMainWin(void) { return (wxScrolledWindow*) m_mainWin; }
wxCoord GetHeaderHeight(void) { return ((wxWindow *)m_headerWin)->GetSize().y; }
......
......@@ -102,6 +102,9 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas
//read in settings and initialize controls
ReadPreferenceSettings();
lastErrorCtrl = NULL;
stdTextBkgdColor = *wxWHITE;
if (! m_bOKToShow) return;
// Get default preference values
......@@ -127,9 +130,6 @@ CDlgAdvPreferences::CDlgAdvPreferences(wxWindow* parent) : CDlgAdvPreferencesBas
m_Notebook->SetMinSize(sz);
}
#endif
lastErrorCtrl = NULL;
stdTextBkgdColor = *wxWHITE;
Layout();
Fit();
Centre();
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
......@@ -99,11 +99,6 @@ CDlgEventLog::CDlgEventLog( wxWindow* parent, wxWindowID id, const wxString& cap
Create(parent, id, caption, pos, size, style);
#ifdef __WXGTK__
m_pList->SaveEventHandler((m_pList->GetMainWin())->GetEventHandler());
(m_pList->GetMainWin())->PushEventHandler(new MyEvtLogEvtHandler(m_pList));
#endif
wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::CDlgEventLog - Constructor Function End"));
}
......@@ -111,10 +106,6 @@ CDlgEventLog::CDlgEventLog( wxWindow* parent, wxWindowID id, const wxString& cap
CDlgEventLog::~CDlgEventLog() {
wxLogTrace(wxT("Function Start/End"), wxT("CDlgEventLog::CDlgEventLog - Destructor Function Begin"));
#ifdef __WXGTK__
(m_pList->GetMainWin())->PopEventHandler(true);
#endif
if (m_pMessageInfoAttr) {
delete m_pMessageInfoAttr;
m_pMessageInfoAttr = NULL;
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
......@@ -39,7 +39,9 @@ BEGIN_EVENT_TABLE(MyEvtLogEvtHandler, wxEvtHandler)
EVT_PAINT(MyEvtLogEvtHandler::OnPaint)
END_EVENT_TABLE()
MyEvtLogEvtHandler::MyEvtLogEvtHandler() {}
MyEvtLogEvtHandler::MyEvtLogEvtHandler() {
m_view_startX = 0;
}
MyEvtLogEvtHandler::MyEvtLogEvtHandler(wxGenericListCtrl *theListControl) {
m_listCtrl = theListControl;
......@@ -89,6 +91,11 @@ CDlgEventLogListCtrl::CDlgEventLogListCtrl(CDlgEventLog* pView, wxWindowID iList
m_bIsSingleSelection = (iListWindowFlags & wxLC_SINGLE_SEL) ? true : false ;
#ifdef __WXGTK__
savedHandler = GetMainWin()->GetEventHandler();
GetMainWin()->PushEventHandler(new MyEvtLogEvtHandler(this));
#endif
#ifdef __WXMAC__
m_fauxHeaderView = NULL;
m_fauxBodyView = NULL;
......@@ -97,12 +104,16 @@ CDlgEventLogListCtrl::CDlgEventLogListCtrl(CDlgEventLog* pView, wxWindowID iList
}
#ifdef __WXMAC__
CDlgEventLogListCtrl::~CDlgEventLogListCtrl()
{
#ifdef __WXGTK__
GetMainWin()->PopEventHandler(true);
#endif
#ifdef __WXMAC__
RemoveMacAccessibilitySupport();
}
#endif
}
wxString CDlgEventLogListCtrl::OnGetItemText(long item, long column) const {
......
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
// Copyright (C) 2015 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
......@@ -42,12 +42,9 @@ public:
CDlgEventLogListCtrl();
CDlgEventLogListCtrl(CDlgEventLog* pView, wxWindowID iListWindowID, int iListWindowFlags);
#ifdef __WXMAC__
~CDlgEventLogListCtrl();
#endif
#ifdef __WXGTK__
void SaveEventHandler(wxEvtHandler *stdHandler) { savedHandler = stdHandler; }
wxEvtHandler* savedHandler;
wxScrolledWindow* GetMainWin(void) { return (wxScrolledWindow*) m_mainWin; }
#endif
......
......@@ -10,7 +10,7 @@ $volid = get_int('volid');
$vol = vol_lookup($volid);
function show_info($vol) {
$x = "<span class=note> Country: $vol->country\n";
$x = "Country: $vol->country\n";
if ($vol->availability) {
$x .= "<br>Usual hours: $vol->availability";
}
......@@ -24,14 +24,13 @@ function show_info($vol) {
$x .= "<br>Primary language: $vol->lang1";
$x .= "<br>Secondary language: $vol->lang2";
}
$x .= "</span><p>";
$x .= "<p>";
return $x;
}
function live_contact($vol) {
$skypeid = $vol->skypeid;
echo "
<font size=+2><b>Contact $vol->name on Skype</b></font>
<script>
if (navigator.userAgent.indexOf('MSIE') != -1) {
document.write(
......@@ -92,7 +91,7 @@ function email_contact($vol) {
Please include a detailed description of the problem
you're experiencing.
If possible, include the contents of BOINC's message log.
If possible, include the contents of BOINC's event log.
</span>",
textarea("message", "")
);
......@@ -200,6 +199,7 @@ if (false) {
live_contact($vol);
}
}
echo "<h2>Contact $vol->name by Skype</h2>\n";
skype_call_button($vol);
email_contact($vol);
echo "</td></tr></table><p>\n";
......
......@@ -838,7 +838,7 @@ function create_post($content, $parent_id, $user, $forum, $thread, $signature) {
$content = BoincDb::escape_string($content);
$now = time();
$sig = $signature?1:0;
$id = BoincPost::insert("(thread, user, timestamp, content, modified, parent_post, score, votes, signature, hidden) values ($thread->id, $user->id, $now, '$content', $now, $parent_id, 0, 0, $sig, 0)");
$id = BoincPost::insert("(thread, user, timestamp, content, modified, parent_post, score, votes, signature, hidden) values ($thread->id, $user->id, $now, '$content', 0, $parent_id, 0, 0, $sig, 0)");
if (!$id) return null;
notify_subscribers($thread, $user);
......
Supports Markdown
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