Skip to content
Snippets Groups Projects
Commit 87b0ce7a authored by Eetu Pesonen's avatar Eetu Pesonen
Browse files

clang-format

parent 77b1e66e
No related branches found
No related tags found
No related merge requests found
BasedOnStyle: WebKit
AccessModifierOffset: -4
BreakBeforeBraces: Allman
IndentExternBlock: NoIndent
IndentWidth: 4
UseTab: Never
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: 'true'
AlignConsecutiveAssignments: 'true'
AlignTrailingComments: 'true'
...@@ -22,11 +22,11 @@ ...@@ -22,11 +22,11 @@
#ifndef H_DEBUG #ifndef H_DEBUG
#define H_DEBUG #define H_DEBUG
#include <cstdio>
#include <cstdarg> #include <cstdarg>
#include <string> #include <cstdio>
#include <iostream>
#include <fstream> #include <fstream>
#include <iostream>
#include <string>
#ifdef DEBUG #ifdef DEBUG
#define DEBUG_TEST 1 #define DEBUG_TEST 1
...@@ -35,8 +35,12 @@ ...@@ -35,8 +35,12 @@
#endif #endif
#define debug_print(fmt, ...) \ #define debug_print(fmt, ...) \
do { if (DEBUG_TEST) printf("%s:%d:%s(): " fmt, __FILE__, \ do \
__LINE__, __func__, __VA_ARGS__); } while (0) { \
if (DEBUG_TEST) \
printf("%s:%d:%s(): " fmt, __FILE__, \
__LINE__, __func__, __VA_ARGS__); \
} while (0)
class Logger class Logger
{ {
......
...@@ -22,6 +22,12 @@ ...@@ -22,6 +22,12 @@
#ifndef H_GLOBALS #ifndef H_GLOBALS
#define H_GLOBALS #define H_GLOBALS
enum size {SIZE_BYTE = 0, SIZE_WORD = 1, SIZE_LONG = 2, SIZE_SPECIAL = 3}; enum size
{
SIZE_BYTE = 0,
SIZE_WORD = 1,
SIZE_LONG = 2,
SIZE_SPECIAL = 3
};
#endif // H_GLOBALS #endif // H_GLOBALS
\ No newline at end of file
...@@ -11,7 +11,10 @@ int main() ...@@ -11,7 +11,10 @@ int main()
RPU32 rpu; RPU32 rpu;
while (rpu.step()); int i = 0;
while (rpu.step())
logger->write("Step %d", i++);
return 0; return 0;
} }
\ No newline at end of file
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <cstdint> #include <cstdint>
#include "regs.h"
#include "debug.h" #include "debug.h"
#include "regs.h"
#include "window.h" #include "window.h"
uint32_t Regs::get(enum reg_names reg, enum size size) uint32_t Regs::get(enum reg_names reg, enum size size)
...@@ -70,6 +70,7 @@ void Regs::draw() ...@@ -70,6 +70,7 @@ void Regs::draw()
{ {
// Print regs in pairs: Dn xxxx An xxxx \n // Print regs in pairs: Dn xxxx An xxxx \n
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
mvwprintw(win, i+1, 2, "D%d: %8.8x A%d: %8.8x", i, regs[i], i, regs[i+REG_A0]); mvwprintw(win, i + 1, 2, "D%d: %8.8x A%d: %8.8x", i, regs[i], i,
regs[i + REG_A0]);
wrefresh(win); wrefresh(win);
} }
...@@ -25,8 +25,8 @@ ...@@ -25,8 +25,8 @@
#include "globals.h" #include "globals.h"
#include "window.h" #include "window.h"
#include <cstdint>
#include <array> #include <array>
#include <cstdint>
enum reg_names enum reg_names
{ {
...@@ -51,7 +51,8 @@ enum reg_names ...@@ -51,7 +51,8 @@ enum reg_names
class Regs : public Drawable class Regs : public Drawable
{ {
public: public:
Regs(int x, int y, int w = 29, int h = 10) : Drawable(w, h, x, y) Regs(int x, int y, int w = 29, int h = 10)
: Drawable(w, h, x, y)
{ {
for (auto& reg : regs) for (auto& reg : regs)
reg = 0; reg = 0;
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
#include <curses.h> #include <curses.h>
#include "rpu32.h"
#include "debug.h" #include "debug.h"
#include "rpu32.h"
#include "regs.h" #include "regs.h"
......
...@@ -34,7 +34,6 @@ public: ...@@ -34,7 +34,6 @@ public:
int step(); int step();
private: private:
}; };
#endif // H_RPU32 #endif // H_RPU32
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment