Mercurial > hg > octave-nkf
changeset 18305:a0c9f5302eae
maint: merge gui-release -> default.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 14 Jan 2014 13:19:58 -0800 |
parents | 00539b673cd4 (current diff) 8d98ebeceab4 (diff) |
children | 87381dbbe25e |
files | configure.ac |
diffstat | 6 files changed, 69 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/configure.ac +++ b/configure.ac @@ -782,12 +782,12 @@ ### Check for the LLVM library -build_jit=yes +build_jit=no AC_ARG_ENABLE([jit], [AS_HELP_STRING([--enable-jit], [(EXPERIMENTAL) enable JIT compiler])], - [if test "$enableval" = no; then - build_jit=no + [if test "$enableval" = yes; then + build_jit=yes fi], []) @@ -2555,9 +2555,9 @@ JAVA_LIBS=-ladvapi32 if test $have_msvc = no; then if test -n "$JAVA_CPPFLAGS"; then - JAVA_CPPFLAGS="-I${JAVA_CPPFLAGS}/include -I${JAVA_CPPFLAGS}/include/win32" + JAVA_CPPFLAGS="-I\"${JAVA_CPPFLAGS}\" -I\"${JAVA_CPPFLAGS}/win32\"" else - JAVA_CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/win32" + JAVA_CPPFLAGS="-I\"${JAVA_HOME}/include\" -I\"${JAVA_HOME}/include/win32\"" fi LDFLAGS="$LDFLAGS -Wl,--export-all-symbols" fi @@ -2655,7 +2655,7 @@ ;; *) if test -n "$JAVA_CPPFLAGS"; then - JAVA_CPPFLAGS="-I${JAVA_CPPFLAGS}/include -I${JAVA_CPPFLAGS}/include/linux" + JAVA_CPPFLAGS="-I${JAVA_CPPFLAGS} -I${JAVA_CPPFLAGS}/linux" else JAVA_CPPFLAGS="-I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux" fi
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp +++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp @@ -575,6 +575,9 @@ void QConsolePrivate::setBackgroundColor (const QColor& color) { m_colors[15] = color; + + QPalette palette (color); + m_consoleView->setPalette (palette); } void QConsolePrivate::setForegroundColor (const QColor& color)
--- a/libgui/src/m-editor/file-editor-tab.cc +++ b/libgui/src/m-editor/file-editor-tab.cc @@ -1168,6 +1168,26 @@ show_dialog (fileDialog); } +bool +file_editor_tab::save_file_check_spaces (QString file_name) +{ + QFileInfo file = QFileInfo(file_name); + + if (file.suffix () == "m" && file.baseName ().contains (' ')) + { + int ans = QMessageBox::question (0, tr ("Octave Editor"), + tr ("It is not advisable to save an Octave script\n" + "in a file with a name containing spaces.\n\n" + "Do you wnat to chose another name?"), + QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); + + if (ans == QMessageBox::Yes) + return true; + } + + return false; +} + void file_editor_tab::handle_save_file_as_answer (const QString& saveFileName) { @@ -1179,7 +1199,10 @@ else { // Have editor check for conflict, do not delete tab after save. - emit editor_check_conflict_save (saveFileName, false); + if (save_file_check_spaces (saveFileName)) + save_file_as (false); + else + emit editor_check_conflict_save (saveFileName, false); } } @@ -1190,7 +1213,10 @@ // when we close a tab and _file_name is not a valid file name yet // Have editor check for conflict, delete tab after save. - emit editor_check_conflict_save (saveFileName, true); + if (save_file_check_spaces (saveFileName)) + save_file_as (true); + else + emit editor_check_conflict_save (saveFileName, true); } void
--- a/libgui/src/m-editor/file-editor-tab.h +++ b/libgui/src/m-editor/file-editor-tab.h @@ -176,6 +176,7 @@ bool valid_file_name (const QString& file=QString ()); void save_file (const QString& saveFileName, bool remove_on_success = false); void save_file_as (bool remove_on_success = false); + bool save_file_check_spaces (QString file_name); void update_lexer (); void request_add_breakpoint (int line);
--- a/libgui/src/main-window.cc +++ b/libgui/src/main-window.cc @@ -262,6 +262,28 @@ void main_window::run_file_in_terminal (const QFileInfo& info) { + QString file_name = info.canonicalFilePath (); + QString command = "run \""+file_name+"\""; + + QString function_name = info.fileName (); + function_name.chop (info.suffix ().length () + 1); + + if (function_name.contains (' ')) + { + int ans = QMessageBox::question (0, tr ("Octave"), + tr ("The file %1\n" + "contains spaces and can not be executed.\n\n" + "Do you want to execute\n%2\n" + "instead?"). + arg (file_name).arg (command), + QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes); + + if (ans == QMessageBox::Yes) + execute_command_in_terminal (command); + + return; + } + octave_link::post_event (this, &main_window::run_file_callback, info); if (focus_console_after_command ()) focus_command_window ();
--- a/libinterp/corefcn/jit-typeinfo.cc +++ b/libinterp/corefcn/jit-typeinfo.cc @@ -872,7 +872,7 @@ jit_operation::to_idx (const std::vector<jit_type*>& types) const { octave_idx_type numel = types.size (); - numel = std::max (2, numel); + numel = std::max (numel, static_cast<octave_idx_type>(2)); Array<octave_idx_type> idx (dim_vector (1, numel)); for (octave_idx_type i = 0; i < static_cast<octave_idx_type> (types.size ()); @@ -1609,12 +1609,8 @@ body = fn.new_block (); builder.SetInsertPoint (body); { - llvm::Value *one = llvm::ConstantInt::get (index_t, 1); - llvm::Value *ione; - if (index_t == int_t) - ione = one; - else - ione = llvm::ConstantInt::get (int_t, 1); + llvm::Value *one_idx = llvm::ConstantInt::get (index_t, 1); + llvm::Value *one_int = llvm::ConstantInt::get (int_t, 1); llvm::Value *undef = llvm::UndefValue::get (scalar_t); llvm::Value *mat = fn.argument (builder, 0); @@ -1624,7 +1620,7 @@ llvm::Value *int_idx = builder.CreateFPToSI (idx, index_t); llvm::Value *check_idx = builder.CreateSIToFP (int_idx, scalar_t); llvm::Value *cond0 = builder.CreateFCmpUNE (idx, check_idx); - llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one); + llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one_idx); llvm::Value *cond = builder.CreateOr (cond0, cond1); llvm::BasicBlock *done = fn.new_block ("done"); @@ -1647,7 +1643,7 @@ builder.CreateCondBr (cond, bounds_error, success); builder.SetInsertPoint (bounds_error); - gindex_range.call (builder, ione, ione, int_idx, len); + gindex_range.call (builder, one_int, one_int, int_idx, len); builder.CreateBr (done); builder.SetInsertPoint (success); @@ -1681,7 +1677,8 @@ body = fn.new_block (); builder.SetInsertPoint (body); { - llvm::Value *one = llvm::ConstantInt::get (index_t, 1); + llvm::Value *one_idx = llvm::ConstantInt::get (index_t, 1); + llvm::Value *one_int = llvm::ConstantInt::get (int_t, 1); llvm::Value *mat = fn.argument (builder, 0); llvm::Value *idx = fn.argument (builder, 1); @@ -1690,7 +1687,7 @@ llvm::Value *int_idx = builder.CreateFPToSI (idx, index_t); llvm::Value *check_idx = builder.CreateSIToFP (int_idx, scalar_t); llvm::Value *cond0 = builder.CreateFCmpUNE (idx, check_idx); - llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one); + llvm::Value *cond1 = builder.CreateICmpSLT (int_idx, one_idx); llvm::Value *cond = builder.CreateOr (cond0, cond1); llvm::BasicBlock *done = fn.new_block ("done"); @@ -1708,7 +1705,7 @@ llvm::Value *rcount = builder.CreateExtractValue (mat, 0); rcount = builder.CreateLoad (rcount); - cond1 = builder.CreateICmpSGT (rcount, one); + cond1 = builder.CreateICmpSGT (rcount, one_int); cond = builder.CreateOr (cond0, cond1); llvm::BasicBlock *bounds_error = fn.new_block ("bounds_error", done);