dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
vlp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
abfcef9
)
Reduce scope of some variables
author
Rafał Długołęcki
<rafal@dlugolecki.net.pl>
Thu, 28 Jan 2016 20:23:53 +0000
(21:23 +0100)
committer
Rafał Długołęcki
<rafal@dlugolecki.net.pl>
Thu, 28 Jan 2016 20:23:53 +0000
(21:23 +0100)
src/kernel/kernel.cpp
patch
|
blob
|
history
diff --git
a/src/kernel/kernel.cpp
b/src/kernel/kernel.cpp
index 27ba55f5e6dcf8d7164a657429cf489aa7bcec0e..c943c48930500408c4d83df06927a861b9ead1e4 100644
(file)
--- a/
src/kernel/kernel.cpp
+++ b/
src/kernel/kernel.cpp
@@
-219,11
+219,10
@@
void QKernel::loadConfig(const char * fname)
*/
void QKernel::on_actionExecute_triggered()
{
*/
void QKernel::on_actionExecute_triggered()
{
- int i;
QString s = QFileDialog::getOpenFileName(this, "Execute", progdir, "*.log");
if (!s.isNull()) {
QString s = QFileDialog::getOpenFileName(this, "Execute", progdir, "*.log");
if (!s.isNull()) {
- i = s.indexOf(".log");
+ i
nt i
= s.indexOf(".log");
if (i > 0)
s.remove(i, 4);
if (i > 0)
s.remove(i, 4);
@@
-528,18
+527,21
@@
void QKernel::on_actionKill_triggered()
KillInterpreterDialog dialog(this);
dialog.setWindowTitle("Kill interpreter");
KillInterpreterDialog dialog(this);
dialog.setWindowTitle("Kill interpreter");
- MESSAGE m;
- InterpEntry *interpreter;
-
if (dialog.exec()) {
if (dialog.exec()) {
+ MESSAGE m;
m.msg_type = MSG_INT;
m.param.pword[0] = INT_KILL;
m.msg_type = MSG_INT;
m.param.pword[0] = INT_KILL;
+
+ InterpEntry *interpreter;
interpreter = findINTbyID(dialog.getInterpreterId());
interpreter = findINTbyID(dialog.getInterpreterId());
+
if (interpreter != NULL) {
if (interpreter != NULL) {
- if (!(interpreter->remote))
+ if (!(interpreter->remote))
{
write(interpreter->sock, &m, sizeof(MESSAGE));
write(interpreter->sock, &m, sizeof(MESSAGE));
- else
+ }
+ else {
WriteMessage("This is a remote instance of a program!");
WriteMessage("This is a remote instance of a program!");
+ }
}
else {
WriteMessage("Interpreter not found");
}
else {
WriteMessage("Interpreter not found");
@@
-556,11
+558,12
@@
void QKernel::NetMessage()
/* TODO: It has to be rewritten */
MESSAGE msg;
int cnt;
/* TODO: It has to be rewritten */
MESSAGE msg;
int cnt;
- char ss[255];
InterpEntry *pom;
cnt = read(net_sock, &msg, sizeof(MESSAGE));
if ((cnt > 0) && (msg.msg_type == MSG_NET)) {
InterpEntry *pom;
cnt = read(net_sock, &msg, sizeof(MESSAGE));
if ((cnt > 0) && (msg.msg_type == MSG_NET)) {
+ char ss[255];
+
switch(msg.param.pword[0]) {
case NET_CSWRITELN:
WriteMessage(msg.param.pstr);
switch(msg.param.pword[0]) {
case NET_CSWRITELN:
WriteMessage(msg.param.pstr);
@@
-1002,7
+1005,6
@@
InterpEntry *QKernel::RunIntModule(char *ss, int r)
void QKernel::RemoteInstance(InterpEntry *interp, int on)
{
MESSAGE m;
void QKernel::RemoteInstance(InterpEntry *interp, int on)
{
MESSAGE m;
- char s[255];
m.msg_type = MSG_NET;
m.param.pword[0] = NET_NODE_EXIST;
m.msg_type = MSG_NET;
m.param.pword[0] = NET_NODE_EXIST;
@@
-1057,6
+1059,7
@@
void QKernel::RemoteInstance(InterpEntry *interp, int on)
m.param.pword[1] = interp->RInstances[on];
write(interp->sock, &m, sizeof(MESSAGE));
} else { /* There is no such a node! */
m.param.pword[1] = interp->RInstances[on];
write(interp->sock, &m, sizeof(MESSAGE));
} else { /* There is no such a node! */
+ char s[255];
sprintf(s, "Warning: Node number %d not found!", on);
WriteMessage(s);
WriteMessage("Allocating O-process on the local node");
sprintf(s, "Warning: Node number %d not found!", on);
WriteMessage(s);
WriteMessage("Allocating O-process on the local node");