Commit 8e3cb152bca65da6ecbdcef5c5cbc6b11d0a8e28
1 parent
18bdb86f
Exists in
master
and in
5 other branches
Removendo warnings
Showing
7 changed files
with
59 additions
and
21 deletions
Show diff stats
configure.ac
| ... | ... | @@ -340,6 +340,7 @@ if test "$app_cv_java" = "yes" ; then |
| 340 | 340 | fi |
| 341 | 341 | |
| 342 | 342 | if test "$app_cv_java" = "yes" ; then |
| 343 | + | |
| 343 | 344 | AC_PATH_TOOL([JAVA], [java], [no], [$JDK_HOME/bin:$JRE_HOME/bin:$PATH]) |
| 344 | 345 | AC_PATH_TOOL([JAVAC], [javac], [no], [$JDK_HOME/bin:$JRE_HOME/bin:$PATH]) |
| 345 | 346 | AC_PATH_TOOL([JAVAH], [javah], [no], [$JDK_HOME/bin:$JRE_HOME/bin:$PATH]) |
| ... | ... | @@ -348,6 +349,9 @@ if test "$app_cv_java" = "yes" ; then |
| 348 | 349 | |
| 349 | 350 | EXTENSIONS="$EXTENSIONS java" |
| 350 | 351 | PLUGINS="$PLUGINS j3270" |
| 352 | +else | |
| 353 | + | |
| 354 | + AC_MSG_NOTICE([jdk is NOT present or disabled.]) | |
| 351 | 355 | |
| 352 | 356 | fi |
| 353 | 357 | ... | ... |
po/pt_BR.po
| ... | ... | @@ -5,7 +5,7 @@ msgid "" |
| 5 | 5 | msgstr "" |
| 6 | 6 | "Project-Id-Version: pw3270 5.0\n" |
| 7 | 7 | "Report-Msgid-Bugs-To: \n" |
| 8 | -"POT-Creation-Date: 2015-06-18 14:22-0300\n" | |
| 8 | +"POT-Creation-Date: 2015-06-18 19:51-0300\n" | |
| 9 | 9 | "PO-Revision-Date: 2014-02-17 08:05-0300\n" |
| 10 | 10 | "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" |
| 11 | 11 | "Language-Team: Portugues <>\n" | ... | ... |
pw3270.cbp
| ... | ... | @@ -110,6 +110,10 @@ |
| 110 | 110 | <Option target="Debug" /> |
| 111 | 111 | <Option target="Release" /> |
| 112 | 112 | </Unit> |
| 113 | + <Unit filename="src/java/clipboard.cc"> | |
| 114 | + <Option target="Debug" /> | |
| 115 | + <Option target="Release" /> | |
| 116 | + </Unit> | |
| 113 | 117 | <Unit filename="src/java/connect.cc"> |
| 114 | 118 | <Option target="Debug" /> |
| 115 | 119 | <Option target="Release" /> |
| ... | ... | @@ -118,6 +122,14 @@ |
| 118 | 122 | <Option target="Debug" /> |
| 119 | 123 | <Option target="Release" /> |
| 120 | 124 | </Unit> |
| 125 | + <Unit filename="src/java/dialog.cc"> | |
| 126 | + <Option target="Debug" /> | |
| 127 | + <Option target="Release" /> | |
| 128 | + </Unit> | |
| 129 | + <Unit filename="src/java/field.cc"> | |
| 130 | + <Option target="Debug" /> | |
| 131 | + <Option target="Release" /> | |
| 132 | + </Unit> | |
| 121 | 133 | <Unit filename="src/java/getset.cc"> |
| 122 | 134 | <Option target="Debug" /> |
| 123 | 135 | <Option target="Release" /> |
| ... | ... | @@ -126,6 +138,10 @@ |
| 126 | 138 | <Option target="Debug" /> |
| 127 | 139 | <Option target="Release" /> |
| 128 | 140 | </Unit> |
| 141 | + <Unit filename="src/java/jni3270.h"> | |
| 142 | + <Option target="Debug" /> | |
| 143 | + <Option target="Release" /> | |
| 144 | + </Unit> | |
| 129 | 145 | <Unit filename="src/java/keyboard.cc"> |
| 130 | 146 | <Option target="Debug" /> |
| 131 | 147 | <Option target="Release" /> | ... | ... |
src/java/Makefile.in
| ... | ... | @@ -118,17 +118,17 @@ $(BINDIR)/java/%.class: %.java $(BINDIR)/java/$(PACKAGE_NAME)/terminal.class |
| 118 | 118 | $(BINDIR)/java/%.class: sample/%.java $(BINDIR)/java/$(PACKAGE_NAME)/terminal.class |
| 119 | 119 | @echo $< ... |
| 120 | 120 | @mkdir -p `dirname $@` |
| 121 | - $(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< | |
| 121 | + @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< | |
| 122 | 122 | |
| 123 | 123 | $(BINDIR)/%.class: sample/%.java $(BINDIR)/java/$(PACKAGE_NAME)/terminal.class |
| 124 | 124 | @echo $< ... |
| 125 | 125 | @mkdir -p `dirname $@` |
| 126 | - $(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< | |
| 126 | + @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d $(BINDIR)/java $< | |
| 127 | 127 | |
| 128 | 128 | %.class: sample/%.java $(BINDIR)/java/$(PACKAGE_NAME)/terminal.class |
| 129 | 129 | @echo $< ... |
| 130 | 130 | @mkdir -p `dirname $@` |
| 131 | - $(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d `dirname $@` $< | |
| 131 | + @$(JAVAC) -encoding utf-8 -cp $(BINDIR)/java -d `dirname $@` $< | |
| 132 | 132 | |
| 133 | 133 | $(BINDIR)/java/$(PACKAGE_NAME)/%.class: %.java |
| 134 | 134 | @echo $< ... |
| ... | ... | @@ -175,7 +175,7 @@ $(BINRLS)/plugins/j3270@DLLEXT@: \ |
| 175 | 175 | |
| 176 | 176 | @echo " LD `basename $@`" |
| 177 | 177 | @$(MKDIR) `dirname $@` |
| 178 | - $(CXX) @SYSDLL_FLAGS@ -Wl,--rpath,$(jnidir) $(LDFLAGS) -Wl,-soname,`basename $@` -o $@ $^ $(CLASS_LIBS) $(PLUGIN_LIBS) -L$(BINRLS)@DLLDIR@ -ljni3270 | |
| 178 | + @$(CXX) @SYSDLL_FLAGS@ -Wl,--rpath,$(jnidir) $(LDFLAGS) -Wl,-soname,`basename $@` -o $@ $^ $(CLASS_LIBS) $(PLUGIN_LIBS) -L$(BINRLS)@DLLDIR@ -ljni3270 | |
| 179 | 179 | |
| 180 | 180 | #---[ Debug targets ]---------------------------------------------------------- |
| 181 | 181 | |
| ... | ... | @@ -197,7 +197,7 @@ $(BINDBG)/plugins/j3270@DLLEXT@: \ |
| 197 | 197 | |
| 198 | 198 | @echo " LD `basename $@`" |
| 199 | 199 | @$(MKDIR) `dirname $@` |
| 200 | - $(CXX) @SYSDLL_FLAGS@ -Wl,--rpath,.bin/Debug@DLLDIR@ $(LDFLAGS) -Wl,-soname,`basename $@` -o $@ $^ $(CLASS_LIBS) $(PLUGIN_LIBS) -L$(BINDBG)@DLLDIR@ -ljni3270 | |
| 200 | + @$(CXX) @SYSDLL_FLAGS@ -Wl,--rpath,.bin/Debug@DLLDIR@ $(LDFLAGS) -Wl,-soname,`basename $@` -o $@ $^ $(CLASS_LIBS) $(PLUGIN_LIBS) -L$(BINDBG)@DLLDIR@ -ljni3270 | |
| 201 | 201 | |
| 202 | 202 | run: $(BINDBG)@DLLDIR@/@DLLPREFIX@jni3270@DLLEXT@ $(BINDIR)/java/testprogram.class |
| 203 | 203 | @LD_LIBRARY_PATH=../../.bin/Debug@DLLDIR@/ java -Djava.library.path=$(BINDBG)@DLLDIR@ -cp .bin/java/ testprogram | ... | ... |
src/java/field.cc
| ... | ... | @@ -34,7 +34,7 @@ |
| 34 | 34 | |
| 35 | 35 | JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1field_1start (JNIEnv *env, jobject obj, jint baddr) { |
| 36 | 36 | |
| 37 | - jint rc; | |
| 37 | + jint rc = -1; | |
| 38 | 38 | |
| 39 | 39 | try { |
| 40 | 40 | |
| ... | ... | @@ -53,7 +53,7 @@ JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1field_1start (JNIEnv *env, jobj |
| 53 | 53 | |
| 54 | 54 | JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1field_1len (JNIEnv *env, jobject obj, jint baddr) { |
| 55 | 55 | |
| 56 | - jint rc; | |
| 56 | + jint rc = -1; | |
| 57 | 57 | |
| 58 | 58 | try { |
| 59 | 59 | |
| ... | ... | @@ -72,7 +72,7 @@ JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1field_1len (JNIEnv *env, jobjec |
| 72 | 72 | |
| 73 | 73 | JNIEXPORT jint JNICALL Java_pw3270_terminal_get_1next_1unprotected(JNIEnv *env, jobject obj, jint baddr) { |
| 74 | 74 | |
| 75 | - jint rc; | |
| 75 | + jint rc = -1; | |
| 76 | 76 | |
| 77 | 77 | try { |
| 78 | 78 | ... | ... |
src/java/plugin.cc
| ... | ... | @@ -418,7 +418,7 @@ extern "C" { |
| 418 | 418 | rc = JNI_CreateJavaVM(&jvm,(void **)&env,&vm_args); |
| 419 | 419 | |
| 420 | 420 | // Release options |
| 421 | - for(size_t f=0;f<vm_args.nOptions;f++) { | |
| 421 | + for(int f=0;f<vm_args.nOptions;f++) { | |
| 422 | 422 | trace("Releasing option %d: %s",f,options[f].optionString); |
| 423 | 423 | g_free(options[f].optionString); |
| 424 | 424 | } | ... | ... |
src/lib3270/util.c
| ... | ... | @@ -219,22 +219,40 @@ LIB3270_EXPORT const char * lib3270_win32_local_charset(void) |
| 219 | 219 | */ |
| 220 | 220 | char * lib3270_vsprintf(const char *fmt, va_list args) |
| 221 | 221 | { |
| 222 | - char *r; | |
| 223 | -#if defined(HAVE_VASPRINTF) /*[*/ | |
| 224 | - (void) vasprintf(&r, fmt, args); | |
| 225 | - if(!r) | |
| 222 | + char *r = NULL; | |
| 223 | + | |
| 224 | +#if defined(HAVE_VASPRINTF) | |
| 225 | + | |
| 226 | + if(vasprintf(&r, fmt, args) < 0 || !r) | |
| 226 | 227 | Error(NULL,"Out of memory in %s",__FUNCTION__); |
| 227 | - return r; | |
| 228 | -#else /*][*/ | |
| 228 | + | |
| 229 | +#else | |
| 230 | + | |
| 229 | 231 | char buf[16384]; |
| 230 | 232 | int nc; |
| 231 | 233 | |
| 232 | 234 | nc = vsnprintf(buf, sizeof(buf), fmt, args); |
| 233 | - if (nc > sizeof(buf)) | |
| 234 | - Error(NULL,"Internal buffer overflow"); | |
| 235 | - r = lib3270_malloc(nc + 1); | |
| 236 | - return strcpy(r, buf); | |
| 237 | -#endif /*]*/ | |
| 235 | + if(nc < 0) | |
| 236 | + { | |
| 237 | + Error(NULL,"Out of memory in %s",__FUNCTION__); | |
| 238 | + } | |
| 239 | + else if (nc < sizeof(buf)) | |
| 240 | + { | |
| 241 | + r = lib3270_malloc(nc + 1); | |
| 242 | + strcpy(r, buf); | |
| 243 | + | |
| 244 | + } | |
| 245 | + else | |
| 246 | + { | |
| 247 | + r = lib3270_malloc(nc + 1); | |
| 248 | + if(vsnprintf(r, nc, fmt, args) < 0) | |
| 249 | + Error(NULL,"Out of memory in %s",__FUNCTION__); | |
| 250 | + | |
| 251 | + } | |
| 252 | + | |
| 253 | +#endif | |
| 254 | + | |
| 255 | + return r; | |
| 238 | 256 | } |
| 239 | 257 | |
| 240 | 258 | LIB3270_EXPORT char * lib3270_strdup_printf(const char *fmt, ...) | ... | ... |