editor: static-ism
There's no reason not to mark these symbols as static; let's do so.
This commit is contained in:
parent
fe0c5ebec2
commit
2e53f4da00
@ -25,19 +25,19 @@
|
|||||||
#include "recentfiles.h"
|
#include "recentfiles.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
const wchar_t *mainWindowClassName = L"MainWindow";
|
static const wchar_t *mainWindowClassName = L"MainWindow";
|
||||||
const char *mainWindowTitle = "GNU Rocket System";
|
static const char *mainWindowTitle = "GNU Rocket System";
|
||||||
const wchar_t *mainWindowTitleW = L"GNU Rocket System";
|
static const wchar_t *mainWindowTitleW = L"GNU Rocket System";
|
||||||
const char *keyName = "SOFTWARE\\GNU Rocket";
|
static const char *keyName = "SOFTWARE\\GNU Rocket";
|
||||||
|
|
||||||
void verror(const char *fmt, va_list va)
|
static void verror(const char *fmt, va_list va)
|
||||||
{
|
{
|
||||||
char temp[4096];
|
char temp[4096];
|
||||||
vsnprintf(temp, sizeof(temp), fmt, va);
|
vsnprintf(temp, sizeof(temp), fmt, va);
|
||||||
MessageBox(NULL, temp, mainWindowTitle, MB_OK | MB_ICONERROR);
|
MessageBox(NULL, temp, mainWindowTitle, MB_OK | MB_ICONERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
void error(const char *fmt, ...)
|
static void error(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
@ -45,7 +45,7 @@ void error(const char *fmt, ...)
|
|||||||
va_end(va);
|
va_end(va);
|
||||||
}
|
}
|
||||||
|
|
||||||
void die(const char *fmt, ...)
|
static void die(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list va;
|
va_list va;
|
||||||
va_start(va, fmt);
|
va_start(va, fmt);
|
||||||
@ -54,13 +54,13 @@ void die(const char *fmt, ...)
|
|||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
HINSTANCE hInst;
|
static HINSTANCE hInst;
|
||||||
HWND hwnd = NULL;
|
static HWND hwnd = NULL;
|
||||||
TrackView *trackView = NULL;
|
static TrackView *trackView = NULL;
|
||||||
HWND trackViewWin = NULL;
|
static HWND trackViewWin = NULL;
|
||||||
HWND statusBarWin = NULL;
|
static HWND statusBarWin = NULL;
|
||||||
HKEY regConfigKey = NULL;
|
static HKEY regConfigKey = NULL;
|
||||||
RecentFiles mruFileList(NULL);
|
static RecentFiles mruFileList(NULL);
|
||||||
|
|
||||||
#define WM_SETROWS (WM_USER+1)
|
#define WM_SETROWS (WM_USER+1)
|
||||||
#define WM_BIASSELECTION (WM_USER+2)
|
#define WM_BIASSELECTION (WM_USER+2)
|
||||||
@ -135,7 +135,7 @@ static LRESULT CALLBACK biasSelectionDialogProc(HWND hDlg, UINT message, WPARAM
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setWindowFileName(std::wstring fileName)
|
static void setWindowFileName(std::wstring fileName)
|
||||||
{
|
{
|
||||||
wchar_t drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
|
wchar_t drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
|
||||||
_wsplitpath(fileName.c_str(), drive, dir, fname, ext);
|
_wsplitpath(fileName.c_str(), drive, dir, fname, ext);
|
||||||
@ -143,7 +143,7 @@ void setWindowFileName(std::wstring fileName)
|
|||||||
SetWindowTextW(hwnd, windowTitle.c_str());
|
SetWindowTextW(hwnd, windowTitle.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
HMENU findSubMenuContaining(HMENU menu, UINT id)
|
static HMENU findSubMenuContaining(HMENU menu, UINT id)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < GetMenuItemCount(menu); ++i)
|
for (int i = 0; i < GetMenuItemCount(menu); ++i)
|
||||||
{
|
{
|
||||||
@ -161,7 +161,7 @@ HMENU findSubMenuContaining(HMENU menu, UINT id)
|
|||||||
return (HMENU)0;
|
return (HMENU)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setDocument(SyncDocument *newDoc)
|
static void setDocument(SyncDocument *newDoc)
|
||||||
{
|
{
|
||||||
SyncDocument *oldDoc = trackView->getDocument();
|
SyncDocument *oldDoc = trackView->getDocument();
|
||||||
|
|
||||||
@ -201,13 +201,13 @@ void setDocument(SyncDocument *newDoc)
|
|||||||
delete oldDoc;
|
delete oldDoc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void fileNew()
|
static void fileNew()
|
||||||
{
|
{
|
||||||
setDocument(new SyncDocument);
|
setDocument(new SyncDocument);
|
||||||
setWindowFileName(L"Untitled");
|
setWindowFileName(L"Untitled");
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadDocument(const std::wstring &_fileName)
|
static void loadDocument(const std::wstring &_fileName)
|
||||||
{
|
{
|
||||||
SyncDocument *newDoc = SyncDocument::load(_fileName);
|
SyncDocument *newDoc = SyncDocument::load(_fileName);
|
||||||
if (newDoc) {
|
if (newDoc) {
|
||||||
@ -224,7 +224,7 @@ void loadDocument(const std::wstring &_fileName)
|
|||||||
error("failed to open file");
|
error("failed to open file");
|
||||||
}
|
}
|
||||||
|
|
||||||
void fileOpen()
|
static void fileOpen()
|
||||||
{
|
{
|
||||||
wchar_t temp[_MAX_FNAME + 1];
|
wchar_t temp[_MAX_FNAME + 1];
|
||||||
temp[0] = L'\0'; // clear string
|
temp[0] = L'\0'; // clear string
|
||||||
@ -243,7 +243,7 @@ void fileOpen()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fileSaveAs()
|
static bool fileSaveAs()
|
||||||
{
|
{
|
||||||
wchar_t temp[_MAX_FNAME + 1];
|
wchar_t temp[_MAX_FNAME + 1];
|
||||||
temp[0] = '\0';
|
temp[0] = '\0';
|
||||||
@ -274,7 +274,7 @@ bool fileSaveAs()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fileSave()
|
static bool fileSave()
|
||||||
{
|
{
|
||||||
SyncDocument *doc = trackView->getDocument();
|
SyncDocument *doc = trackView->getDocument();
|
||||||
if (doc->fileName.empty())
|
if (doc->fileName.empty())
|
||||||
@ -288,7 +288,7 @@ bool fileSave()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void attemptQuit()
|
static void attemptQuit()
|
||||||
{
|
{
|
||||||
SyncDocument *doc = trackView->getDocument();
|
SyncDocument *doc = trackView->getDocument();
|
||||||
if (doc->modified()) {
|
if (doc->modified()) {
|
||||||
@ -529,7 +529,7 @@ static ATOM registerMainWindowClass(HINSTANCE hInstance)
|
|||||||
return RegisterClassExW(&wc);
|
return RegisterClassExW(&wc);
|
||||||
}
|
}
|
||||||
|
|
||||||
SOCKET clientConnect(SOCKET serverSocket, sockaddr_in *host)
|
static SOCKET clientConnect(SOCKET serverSocket, sockaddr_in *host)
|
||||||
{
|
{
|
||||||
sockaddr_in hostTemp;
|
sockaddr_in hostTemp;
|
||||||
int hostSize = sizeof(sockaddr_in);
|
int hostSize = sizeof(sockaddr_in);
|
||||||
@ -554,8 +554,8 @@ SOCKET clientConnect(SOCKET serverSocket, sockaddr_in *host)
|
|||||||
return clientSocket;
|
return clientSocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t clientIndex;
|
static size_t clientIndex;
|
||||||
void processCommand(ClientSocket &sock)
|
static void processCommand(ClientSocket &sock)
|
||||||
{
|
{
|
||||||
SyncDocument *doc = trackView->getDocument();
|
SyncDocument *doc = trackView->getDocument();
|
||||||
int strLen, serverIndex, newRow;
|
int strLen, serverIndex, newRow;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user