Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

editor: static-ism

There's no reason not to mark these symbols as static; let's do so.
  • Loading branch information...
commit 2e53f4da00ef791dd766a73150c8b4489a3e8506 1 parent fe0c5eb
Erik Faye-Lund authored

Showing 1 changed file with 26 additions and 26 deletions. Show diff stats Hide diff stats

  1. +26 26 editor/editor.cpp
52 editor/editor.cpp
@@ -25,19 +25,19 @@
25 25 #include "recentfiles.h"
26 26
27 27 #include <vector>
28   -const wchar_t *mainWindowClassName = L"MainWindow";
29   -const char *mainWindowTitle = "GNU Rocket System";
30   -const wchar_t *mainWindowTitleW = L"GNU Rocket System";
31   -const char *keyName = "SOFTWARE\\GNU Rocket";
  28 +static const wchar_t *mainWindowClassName = L"MainWindow";
  29 +static const char *mainWindowTitle = "GNU Rocket System";
  30 +static const wchar_t *mainWindowTitleW = L"GNU Rocket System";
  31 +static const char *keyName = "SOFTWARE\\GNU Rocket";
32 32
33   -void verror(const char *fmt, va_list va)
  33 +static void verror(const char *fmt, va_list va)
34 34 {
35 35 char temp[4096];
36 36 vsnprintf(temp, sizeof(temp), fmt, va);
37 37 MessageBox(NULL, temp, mainWindowTitle, MB_OK | MB_ICONERROR);
38 38 }
39 39
40   -void error(const char *fmt, ...)
  40 +static void error(const char *fmt, ...)
41 41 {
42 42 va_list va;
43 43 va_start(va, fmt);
@@ -45,7 +45,7 @@ void error(const char *fmt, ...)
45 45 va_end(va);
46 46 }
47 47
48   -void die(const char *fmt, ...)
  48 +static void die(const char *fmt, ...)
49 49 {
50 50 va_list va;
51 51 va_start(va, fmt);
@@ -54,13 +54,13 @@ void die(const char *fmt, ...)
54 54 exit(EXIT_FAILURE);
55 55 }
56 56
57   -HINSTANCE hInst;
58   -HWND hwnd = NULL;
59   -TrackView *trackView = NULL;
60   -HWND trackViewWin = NULL;
61   -HWND statusBarWin = NULL;
62   -HKEY regConfigKey = NULL;
63   -RecentFiles mruFileList(NULL);
  57 +static HINSTANCE hInst;
  58 +static HWND hwnd = NULL;
  59 +static TrackView *trackView = NULL;
  60 +static HWND trackViewWin = NULL;
  61 +static HWND statusBarWin = NULL;
  62 +static HKEY regConfigKey = NULL;
  63 +static RecentFiles mruFileList(NULL);
64 64
65 65 #define WM_SETROWS (WM_USER+1)
66 66 #define WM_BIASSELECTION (WM_USER+2)
@@ -135,7 +135,7 @@ static LRESULT CALLBACK biasSelectionDialogProc(HWND hDlg, UINT message, WPARAM
135 135 return FALSE;
136 136 }
137 137
138   -void setWindowFileName(std::wstring fileName)
  138 +static void setWindowFileName(std::wstring fileName)
139 139 {
140 140 wchar_t drive[_MAX_DRIVE],dir[_MAX_DIR],fname[_MAX_FNAME],ext[_MAX_EXT];
141 141 _wsplitpath(fileName.c_str(), drive, dir, fname, ext);
@@ -143,7 +143,7 @@ void setWindowFileName(std::wstring fileName)
143 143 SetWindowTextW(hwnd, windowTitle.c_str());
144 144 }
145 145
146   -HMENU findSubMenuContaining(HMENU menu, UINT id)
  146 +static HMENU findSubMenuContaining(HMENU menu, UINT id)
147 147 {
148 148 for (int i = 0; i < GetMenuItemCount(menu); ++i)
149 149 {
@@ -161,7 +161,7 @@ HMENU findSubMenuContaining(HMENU menu, UINT id)
161 161 return (HMENU)0;
162 162 }
163 163
164   -void setDocument(SyncDocument *newDoc)
  164 +static void setDocument(SyncDocument *newDoc)
165 165 {
166 166 SyncDocument *oldDoc = trackView->getDocument();
167 167
@@ -201,13 +201,13 @@ void setDocument(SyncDocument *newDoc)
201 201 delete oldDoc;
202 202 }
203 203
204   -void fileNew()
  204 +static void fileNew()
205 205 {
206 206 setDocument(new SyncDocument);
207 207 setWindowFileName(L"Untitled");
208 208 }
209 209
210   -void loadDocument(const std::wstring &_fileName)
  210 +static void loadDocument(const std::wstring &_fileName)
211 211 {
212 212 SyncDocument *newDoc = SyncDocument::load(_fileName);
213 213 if (newDoc) {
@@ -224,7 +224,7 @@ void loadDocument(const std::wstring &_fileName)
224 224 error("failed to open file");
225 225 }
226 226
227   -void fileOpen()
  227 +static void fileOpen()
228 228 {
229 229 wchar_t temp[_MAX_FNAME + 1];
230 230 temp[0] = L'\0'; // clear string
@@ -243,7 +243,7 @@ void fileOpen()
243 243 }
244 244 }
245 245
246   -bool fileSaveAs()
  246 +static bool fileSaveAs()
247 247 {
248 248 wchar_t temp[_MAX_FNAME + 1];
249 249 temp[0] = '\0';
@@ -274,7 +274,7 @@ bool fileSaveAs()
274 274 return false;
275 275 }
276 276
277   -bool fileSave()
  277 +static bool fileSave()
278 278 {
279 279 SyncDocument *doc = trackView->getDocument();
280 280 if (doc->fileName.empty())
@@ -288,7 +288,7 @@ bool fileSave()
288 288 return true;
289 289 }
290 290
291   -void attemptQuit()
  291 +static void attemptQuit()
292 292 {
293 293 SyncDocument *doc = trackView->getDocument();
294 294 if (doc->modified()) {
@@ -529,7 +529,7 @@ static ATOM registerMainWindowClass(HINSTANCE hInstance)
529 529 return RegisterClassExW(&wc);
530 530 }
531 531
532   -SOCKET clientConnect(SOCKET serverSocket, sockaddr_in *host)
  532 +static SOCKET clientConnect(SOCKET serverSocket, sockaddr_in *host)
533 533 {
534 534 sockaddr_in hostTemp;
535 535 int hostSize = sizeof(sockaddr_in);
@@ -554,8 +554,8 @@ SOCKET clientConnect(SOCKET serverSocket, sockaddr_in *host)
554 554 return clientSocket;
555 555 }
556 556
557   -size_t clientIndex;
558   -void processCommand(ClientSocket &sock)
  557 +static size_t clientIndex;
  558 +static void processCommand(ClientSocket &sock)
559 559 {
560 560 SyncDocument *doc = trackView->getDocument();
561 561 int strLen, serverIndex, newRow;

0 comments on commit 2e53f4d

Please sign in to comment.
Something went wrong with that request. Please try again.