summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakshay-c2019-06-27 10:23:57 +0530
committerakshay-c2019-06-27 10:23:57 +0530
commitd173a9be97cab476f2dd1aa9a43fef06e215ee57 (patch)
tree266973b96547e796d70f4043618d97a7a3738629
parent3f7c4198a528cda5f027d26d103a8b228e82474b (diff)
downloadLDmicroQt-d173a9be97cab476f2dd1aa9a43fef06e215ee57.tar.gz
LDmicroQt-d173a9be97cab476f2dd1aa9a43fef06e215ee57.tar.bz2
LDmicroQt-d173a9be97cab476f2dd1aa9a43fef06e215ee57.zip
Code Beautification
-rw-r--r--ldmicro/arduino.cpp2
-rw-r--r--ldmicro/draw_outputdev.cpp3
-rw-r--r--ldmicro/helpdialog.cpp3
-rw-r--r--ldmicro/includes/ldmicro.h3
-rw-r--r--ldmicro/ldmicro.cpp3
-rw-r--r--ldmicro/lib/freezeLD/freezeLD.cpp12
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.h5
-rw-r--r--ldmicro/maincontrols.cpp4
-rw-r--r--ldmicro/miscutil.cpp12
-rw-r--r--ldmicro/simpledialog.cpp8
10 files changed, 32 insertions, 23 deletions
diff --git a/ldmicro/arduino.cpp b/ldmicro/arduino.cpp
index 41b31b1..be3a035 100644
--- a/ldmicro/arduino.cpp
+++ b/ldmicro/arduino.cpp
@@ -533,8 +533,6 @@ static void ClearBit(DWORD addr, int bit)
Instruction(OP_ST_X, 16, 0);
}
-//======================================================================================================>2:42 AM 3/29/2015>Akshay
-
//-----------------------------------------------------------------------------
// Configure AVR 16-bit Timer1 to do the timing for us.
//-----------------------------------------------------------------------------
diff --git a/ldmicro/draw_outputdev.cpp b/ldmicro/draw_outputdev.cpp
index 1b3921d..d38f3a8 100644
--- a/ldmicro/draw_outputdev.cpp
+++ b/ldmicro/draw_outputdev.cpp
@@ -292,7 +292,8 @@ void PaintWidget::paintEvent(QPaintEvent *event)
/*if(((cy + thisHeight) >= (ScrollYOffset - 8)*POS_HEIGHT) &&
(cy < (ScrollYOffset + rowsAvailable + 8)*POS_HEIGHT))*/
{
- SetBkColor(DrawWindow, Hcr, InSimulationMode ? HighlightColours.simBg :
+ SetBkColor(DrawWindow, Hcr,
+ InSimulationMode ? HighlightColours.simBg :
HighlightColours.bg);
SetTextColor(Hcr, InSimulationMode ? HighlightColours.simRungNum :
HighlightColours.rungNum);
diff --git a/ldmicro/helpdialog.cpp b/ldmicro/helpdialog.cpp
index 3df325d..79791f1 100644
--- a/ldmicro/helpdialog.cpp
+++ b/ldmicro/helpdialog.cpp
@@ -156,7 +156,8 @@ static void MakeControls(int a)
copy[j] = '\0';
COLORREF color = RGB(110, 255, 110);
cf.setForeground(QBrush(color));
- RichEdit[a]->appendPlainText(QString::fromStdString((const char*)copy));
+ RichEdit[a]->appendPlainText(
+ QString::fromStdString((const char*)copy));
RichEdit[a]->setCurrentCharFormat(cf);
// Special case if there's nothing except title on the line
if(!justHeading) {
diff --git a/ldmicro/includes/ldmicro.h b/ldmicro/includes/ldmicro.h
index a31c742..788c580 100644
--- a/ldmicro/includes/ldmicro.h
+++ b/ldmicro/includes/ldmicro.h
@@ -635,7 +635,8 @@ extern HMENU ScrollWindow;
// draw.cpp
int ProgCountWidestRow(void);
int CountHeightOfElement(int which, void *elem);
-BOOL DrawElement(HCRDC Hcr, int which, void *elem, int *cx, int *cy, BOOL poweredBefore);
+BOOL DrawElement(HCRDC Hcr, int which, void *elem,
+ int *cx, int *cy, BOOL poweredBefore);
void DrawEndRung(HCRDC Hcr, int cx, int cy);
extern int ColsAvailable;
extern BOOL SelectionActive;
diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp
index 6269fcd..8181c4a 100644
--- a/ldmicro/ldmicro.cpp
+++ b/ldmicro/ldmicro.cpp
@@ -926,7 +926,8 @@ inline void MenuHandler ()
}
//Connect map to combined function call
- QObject::connect (CommandMapper, SIGNAL(mapped(int)), &MenuHandle, SLOT(LD_WM_Command_call(int))) ;
+ QObject::connect (CommandMapper, SIGNAL(mapped(int)),
+ &MenuHandle, SLOT(LD_WM_Command_call(int))) ;
}
void ActivateItem(QTreeWidgetItem* item, int column)
{
diff --git a/ldmicro/lib/freezeLD/freezeLD.cpp b/ldmicro/lib/freezeLD/freezeLD.cpp
index b2cdf24..83c7f6a 100644
--- a/ldmicro/lib/freezeLD/freezeLD.cpp
+++ b/ldmicro/lib/freezeLD/freezeLD.cpp
@@ -304,9 +304,11 @@ void FreezeStringF(char *val, char *subKey, char *name)
return;
}
- sprintf(moveToKeyLocatin, "mkdir -p %s/%s/%s", getenv("HOME"), FREEZE_REGISTER, subKey);
+ sprintf(moveToKeyLocatin, "mkdir -p %s/%s/%s", getenv("HOME"),
+ FREEZE_REGISTER, subKey);
system(moveToKeyLocatin);
- sprintf(moveToKeyLocatin, "%s/%s/%s", getenv("HOME"), FREEZE_REGISTER, subKey);
+ sprintf(moveToKeyLocatin, "%s/%s/%s", getenv("HOME"),
+ FREEZE_REGISTER, subKey);
if (-1 == chdir(moveToKeyLocatin))
{
free(Ld_CWD);
@@ -325,7 +327,8 @@ void FreezeStringF(char *val, char *subKey, char *name)
}
/*
- * retrieve a string setting, or return the default if that setting is unavailable
+ * retrieve a string setting, or return
+ * the default if that setting is unavailable
*/
void ThawStringF(char *val, int max, char *subKey, char *name)
{
@@ -342,7 +345,8 @@ void ThawStringF(char *val, int max, char *subKey, char *name)
return;
}
- sprintf(moveToKeyLocatin, "%s/%s/%s", getenv("HOME"), FREEZE_REGISTER, subKey);
+ sprintf(moveToKeyLocatin, "%s/%s/%s",
+ getenv("HOME"), FREEZE_REGISTER, subKey);
if (-1 == chdir(moveToKeyLocatin))
{
free(Ld_CWD);
diff --git a/ldmicro/lib/linuxUI/linuxUI.h b/ldmicro/lib/linuxUI/linuxUI.h
index f35b9be..5459920 100644
--- a/ldmicro/lib/linuxUI/linuxUI.h
+++ b/ldmicro/lib/linuxUI/linuxUI.h
@@ -36,16 +36,13 @@
#include <string.h>
#include <stdlib.h>
#include "linuxLD.h"
+#include "ldmicroVC.h"
// 4000 ICON "ldmicro.ico"
#define TRUE true
#define FALSE false
-/// version control
-#define LDMicro_VERSION_MAJOR 1
-#define LDMicro_VERSION_MINOR 0
-
// Timer IDs associated with the main window.
#define TIMER_BLINK_CURSOR 1
#define TIMER_SIMULATE 2
diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp
index f238c4a..c290953 100644
--- a/ldmicro/maincontrols.cpp
+++ b/ldmicro/maincontrols.cpp
@@ -41,7 +41,7 @@ static HMENU EditMenu;
static HMENU InstructionMenu;
static HMENU ProcessorMenu;
static HMENU SimulateMenu;
-static HMENU TopMenu; // Menu Bar
+static HMENU TopMenu;
static HMENU Settings;
static HMENU Compile;
static HMENU Help;
@@ -106,7 +106,7 @@ QAction* InsertPwlMenu;
QAction* McuSettingsMenu;
QAction* ProcessorMenuItems[NUM_SUPPORTED_MCUS+1];
-HMENU MicroControllerMenu; // Item for Microcontroller
+HMENU MicroControllerMenu;
QAction* SimulationModeMenu;
QAction* StartSimulationMenu;
diff --git a/ldmicro/miscutil.cpp b/ldmicro/miscutil.cpp
index 2a9b6f1..751fd8e 100644
--- a/ldmicro/miscutil.cpp
+++ b/ldmicro/miscutil.cpp
@@ -222,8 +222,10 @@ void NiceFont(HWID h)
qtfont.setFamily(MyNiceFont->lpszFace);
qtfont.setPixelSize(MyNiceFont->nHeight - 3);
qtfont.setFixedPitch(TRUE);
- qtfont.setStyle(MyNiceFont->fdwItalic ? QFont::StyleItalic : QFont::StyleNormal);
- qtfont.setWeight(MyNiceFont->fnWeight == FW_BOLD ? QFont::Bold : QFont::Normal);
+ qtfont.setStyle(
+ MyNiceFont->fdwItalic ? QFont::StyleItalic : QFont::StyleNormal);
+ qtfont.setWeight(
+ MyNiceFont->fnWeight == FW_BOLD ? QFont::Bold : QFont::Normal);
h->setFont(qtfont);
// SendMessage(h, WM_SETFONT, (WPARAM)MyNiceFont, TRUE);
@@ -239,8 +241,10 @@ void FixedFont(HWID h)
qtfont.setFamily(MyFixedFont->lpszFace);
qtfont.setPixelSize(MyFixedFont->nHeight - 3);
qtfont.setFixedPitch(TRUE);
- qtfont.setStyle(MyFixedFont->fdwItalic ? QFont::StyleItalic : QFont::StyleNormal);
- qtfont.setWeight(MyFixedFont->fnWeight == FW_BOLD ? QFont::Bold : QFont::Normal);
+ qtfont.setStyle(
+ MyFixedFont->fdwItalic ? QFont::StyleItalic : QFont::StyleNormal);
+ qtfont.setWeight(
+ MyFixedFont->fnWeight == FW_BOLD ? QFont::Bold : QFont::Normal);
h->setFont(qtfont);
// SendMessage(h, WM_SETFONT, (WPARAM)MyFixedFont, TRUE);
}
diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp
index a22ae99..659f177 100644
--- a/ldmicro/simpledialog.cpp
+++ b/ldmicro/simpledialog.cpp
@@ -114,8 +114,10 @@ static void MakeControls(int boxes, char **labels, DWORD fixedFontMask)
}
SimpleGrid->addLayout(grid, 0,0);
SimpleGrid->addWidget(ButtonBox, 0, 1);
- QObject::connect(ButtonBox, SIGNAL(accepted()), SimpleDialog, SLOT(accept()));
- QObject::connect(ButtonBox, SIGNAL(rejected()), SimpleDialog, SLOT(reject()));
+ QObject::connect(ButtonBox, SIGNAL(accepted()),
+ SimpleDialog, SLOT(accept()));
+ QObject::connect(ButtonBox, SIGNAL(rejected()),
+ SimpleDialog, SLOT(reject()));
}
BOOL ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask,
@@ -166,7 +168,7 @@ BOOL ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask,
strncpy(get, Textboxes[i]->text().toStdString().c_str(),15);
if( (!strchr(get, '\'')) ||
- (get[0] == '\'' && get[2] == '\'' && strlen(get)==3) )
+ (get[0] == '\'' && get[2] == '\'' && strlen(get)==3) )
{
if(strlen(get) == 0) {
Error(_("Empty textbox; not permitted."));