Simplified API.

Simplified API.

--- src/LDAP.cc
+++ src/LDAP.cc
@@ -19,10 +19,9 @@
 static Persistent<String> symbol_search_paged;
 static Persistent<String> symbol_error;
 static Persistent<String> symbol_result;
-static Persistent<String> symbol_syncresult;
 static Persistent<String> symbol_syncentry;
-static Persistent<String> symbol_syncintermediate;
-static Persistent<String> symbol_syncidset;
+static Persistent<String> symbol_syncrefresh;
+static Persistent<String> symbol_syncrefreshdone;
 static Persistent<String> symbol_syncnewcookie;
 static Persistent<String> symbol_unknown;
 static Persistent<String> emit_symbol;
@@ -32,6 +31,12 @@
 static Persistent<Function> ldapConstructor;

 struct timeval ldap_tv = { 0, 0 }; // static struct used to make ldap_result non-blocking
+
+typedef enum {
+  LDAP_SYNC_REFRESH,
+  LDAP_SYNC_PERSIST
+} ldap_syncphase;
+

 #define REQ_FUN_ARG(I, VAR)                                             \
   if (args.Length() <= (I) || !args[I]->IsFunction())                   \
@@ -97,6 +102,7 @@
 private:
   LDAP  *ld;
   unsigned int sync_id;
+  ldap_syncphase syncphase;
   ldap_sync_refresh_t refreshPhase;
   ev_io read_watcher_;
   ev_io write_watcher_;
@@ -119,10 +125,9 @@
     symbol_search_paged = NODE_PSYMBOL("searchresultpaged");
     symbol_error = NODE_PSYMBOL("error");
     symbol_result = NODE_PSYMBOL("result");
-    symbol_syncresult = NODE_PSYMBOL("syncresult");
     symbol_syncentry = NODE_PSYMBOL("syncentry");
-    symbol_syncintermediate = NODE_PSYMBOL("syncintermediate");
-    symbol_syncidset = NODE_PSYMBOL("syncidset");
+    symbol_syncrefresh = NODE_PSYMBOL("syncrefresh");
+    symbol_syncrefreshdone = NODE_PSYMBOL("syncrefreshdone");
     symbol_syncnewcookie = NODE_PSYMBOL("newcookie");
     symbol_unknown = NODE_PSYMBOL("unknown");
     emit_symbol = NODE_PSYMBOL("emit");//define the event symbol
@@ -562,6 +567,7 @@
     Local<Array>  js_attr_vals;
     int j;
     char * dn;
+    LDAPControl **ctrls = NULL;

     int entry_count = ldap_count_entries(c->ld, msg);

@@ -569,11 +575,51 @@

     for (entry = ldap_first_entry(c->ld, msg), j = 0 ; entry ;
          entry = ldap_next_entry(c->ld, entry), j++) {
+
       js_result = Object::New();
       js_result_list->Set(Integer::New(j), js_result);

       dn = ldap_get_dn(c->ld, entry);

+      // get sync controls, if present...
+      ldap_get_entry_controls( c->ld, entry, &ctrls );
+      if ( ctrls != NULL ) {
+        struct berval entryUUID = { 0 };
+        int state, i;
+        BerElement *ber = NULL;
+
+        for ( i = 0; ctrls[ i ] != NULL; i++ ) {
+          if ( strcmp( ctrls[ i ]->ldctl_oid, LDAP_CONTROL_SYNC_STATE ) == 0 ) {
+            break;
+          }
+        }
+        if ( ctrls[ i ] != NULL ) {
+          /* extract data */
+          ber = ber_init( &ctrls[ i ]->ldctl_value );
+          if ( ber != NULL ) {
+            /* scan entryUUID in-place ("m") */
+            if ( ber_scanf( ber, "{em" /*"}"*/, &state, &entryUUID ) == LBER_ERROR || entryUUID.bv_len != 0 ) {
+              uint32_t status;
+              char * uuid;
+              struct berval cookie;
+              ber_len_t		len;
+
+              uuid_to_string((const uuid_t *)entryUUID.bv_val, &uuid, &status);
+              js_result->Set(String::New("_syncUUID"), String::New(uuid));
+              js_result->Set(String::New("_syncState"), Integer::New(state));
+              free(uuid);
+
+              // There may also be a cookie in here...
+              if (ber_peek_tag(ber, &len) == LDAP_TAG_SYNC_COOKIE) {
+                if (ber_scanf(ber, "m", &cookie) != LBER_ERROR) {
+                  emitcookie(c, cookie);
+                }
+              }
+            }
+          }
+        }
+        // TODO: free controls?
+      }
       for (attrname = ldap_first_attribute(c->ld, entry, &berptr) ;
            attrname ; attrname = ldap_next_attribute(c->ld, entry, berptr)) {
         vals = ldap_get_values(c->ld, entry, attrname);
@@ -594,12 +640,6 @@
     return scope.Close(js_result_list);
   }

-
-      // we'll need this to extract the controls, etc.
-      //          ldap_parse_result(c->ld, msg, &error, NULL, &errmsg, NULL,
-      //                          &srv_controls, 0); //todo - check result
-
-
   static void
   io_event (EV_P_ ev_io *w, int revents)
   {
@@ -710,12 +750,12 @@

     ber = ber_alloc_t( LBER_USE_DER );

-    c->refreshPhase = LDAP_SYNC_CAPI_NONE;
+    c->syncphase = LDAP_SYNC_REFRESH;

     if ( args[4]->IsUndefined()) {
       ber_printf( ber, "{eb}", LDAP_SYNC_REFRESH_AND_PERSIST, 0 );
     } else {
-      ber_printf( ber, "{esb}", LDAP_SYNC_REFRESH_AND_PERSIST, *cookie, 1 );
+      ber_printf( ber, "{esb}", LDAP_SYNC_REFRESH_AND_PERSIST, *cookie, 0 );
     }

     rc = ber_flatten2( ber, &ctrl.ldctl_value, 0 );
@@ -728,6 +768,9 @@
     free(bufhead);

     if ( rc != LDAP_SUCCESS ) {
+      if (rc == LDAP_SYNC_REFRESH_REQUIRED) {
+        fprintf(stderr, "REFRESH REQUIRED!\n");
+      }
       msgid = -1;
     }

@@ -746,7 +789,6 @@
     unsigned int msgid;
     int refreshDone;

-
     for ( ; ; )
       switch(ldap_result(c->ld, c->sync_id, LDAP_MSG_RECEIVED, &ldap_tv, &res) > 0) {
       case 0:
@@ -788,6 +830,16 @@

     return;
+  }
+
+  static void emitcookie(LDAPConnection * c, struct berval cookie) {
+    Handle<Value> args[3];
+
+    if (cookie.bv_len != 0) {
+      args[0] = symbol_syncnewcookie;
+      args[1] = String::New(cookie.bv_val);
+      EMIT(c, 2, args);
+    }
   }

   Local<Value> uuid2array (BerVarray syncUUIDs) {
@@ -813,226 +865,15 @@

   static int sync_search_entry( LDAPConnection * c, LDAPMessage * res ) {
-    LDAPControl **ctrls = NULL;
-    int	rc = LDAP_OTHER;
-    int i;
-    BerElement *ber = NULL;
-    struct berval entryUUID = { 0 }, cookie = { 0 };
-    int	state = -1;
-    ber_len_t len;
-
-    assert( res != NULL );
-
-    /* extract controls */
-    ldap_get_entry_controls( c->ld, res, &ctrls );
-    if ( ctrls == NULL ) {
-      goto done;
-    }
-
-    /* lookup the sync state control */
-    for ( i = 0; ctrls[ i ] != NULL; i++ ) {
-      if ( strcmp( ctrls[ i ]->ldctl_oid, LDAP_CONTROL_SYNC_STATE ) == 0 ) {
-        break;
-      }
-    }
-
-    /* control must be present; there might be other... */
-    if ( ctrls[ i ] == NULL ) {
-      goto done;
-    }
-
-    /* extract data */
-    ber = ber_init( &ctrls[ i ]->ldctl_value );
-    if ( ber == NULL ) {
-      goto done;
-    }
-    /* scan entryUUID in-place ("m") */
-    if ( ber_scanf( ber, "{em" /*"}"*/, &state, &entryUUID ) == LBER_ERROR || entryUUID.bv_len == 0 ) {
-      goto done;
-    }
-
-    if ( ber_peek_tag( ber, &len ) == LDAP_TAG_SYNC_COOKIE ) {
-      /* scan cookie in-place ("m") */
-      if ( ber_scanf( ber, /*"{"*/ "m}", &cookie ) == LBER_ERROR ) {
-        goto done;
-      }
-    }
-
-    switch ( state ) {
-    case LDAP_SYNC_PRESENT:
-    case LDAP_SYNC_DELETE:
-    case LDAP_SYNC_ADD:
-    case LDAP_SYNC_MODIFY:
-      /* NOTE: ldap_sync_refresh_t is defined
-       * as the corresponding LDAP_SYNC_*
-       * for the 4 above cases */
-      c->refreshPhase = (ldap_sync_refresh_t) state;
-      break;
-
-    default:
-      goto done;
-    }
-
-    {
-      Handle<Value> args[4];
-      char * uuid = NULL;
-
-      if (entryUUID.bv_len) {
-        uint32_t status;
-        uuid_to_string((const uuid_t *)entryUUID.bv_val, &uuid, &status);
-      }
-
-      args[0] = symbol_syncnewcookie;
-      args[1] = cookie.bv_len?String::New(cookie.bv_val):Undefined();;
-      EMIT(c, 2, args);
-
-      args[0] = symbol_syncentry;
-      args[1] = c->parseReply(c, res);
-      args[2] = entryUUID.bv_len?String::New(uuid):Undefined();
-      args[3] = Integer::New(c->refreshPhase);
-      EMIT(c, 4, args);
-
-      if (uuid) free(uuid);
-    }
-
-  done:;
-    if ( ber != NULL ) {
-      ber_free( ber, 1 );
-    }
-
-    if ( ctrls != NULL ) {
-      ldap_controls_free( ctrls );
-    }
-
-    return rc;
-  }
-
-
-  static int sync_search_result( LDAPConnection * c, LDAPMessage *res ) {
-    int	err;
-    char *matched = NULL, *msg = NULL;
-    LDAPControl	**ctrls = NULL;
-    int	rc;
-    int	refreshDeletes = -1;
-    struct berval	cookie = { 0 };
-
-    /* should not happen in refreshAndPersist... */
-    rc = ldap_parse_result( c->ld, res, &err, &matched, &msg, NULL, &ctrls, 0 );
-    if ( rc == LDAP_SUCCESS ) {
-      rc = err;
-    }
-
-    c->refreshPhase = LDAP_SYNC_CAPI_DONE;
-
-    switch ( rc ) {
-    case LDAP_SUCCESS: {
-      int		i;
-      BerElement	*ber = NULL;
-      ber_len_t	len;
-
-      rc = LDAP_OTHER;
-
-      /* deal with control; then fallthru to handler */
-      if ( ctrls == NULL ) {
-        goto done;
-      }
-
-      /* lookup the sync state control */
-      for ( i = 0; ctrls[ i ] != NULL; i++ ) {
-        if ( strcmp( ctrls[ i ]->ldctl_oid, LDAP_CONTROL_SYNC_DONE ) == 0 )          {
-            break;
-        }
-      }
-
-      /* control must be present; there might be other... */
-      if ( ctrls[ i ] == NULL ) {
-        goto done;
-      }
-
-      /* extract data */
-      ber = ber_init( &ctrls[ i ]->ldctl_value );
-      if ( ber == NULL ) {
-        goto done;
-      }
-
-      if ( ber_scanf( ber, "{" /*"}"*/) == LBER_ERROR ) {
-        goto ber_done;
-      }
-      if ( ber_peek_tag( ber, &len ) == LDAP_TAG_SYNC_COOKIE ) {
-        if ( ber_scanf( ber, "m", &cookie ) == LBER_ERROR ) {
-          goto ber_done;
-        }
-      }
-
-      refreshDeletes = 0;
-      if ( ber_peek_tag( ber, &len ) == LDAP_TAG_REFRESHDELETES ) {
-        if ( ber_scanf( ber, "b", &refreshDeletes ) == LBER_ERROR ) {
-          goto ber_done;
-        }
-        if ( refreshDeletes ) {
-          refreshDeletes = 1;
-        }
-      }
-
-      if ( ber_scanf( ber, /*"{"*/ "}" ) != LBER_ERROR ) {
-        rc = LDAP_SUCCESS;
-      }
-
-      ber_done:;
-      ber_free( ber, 1 );
-      if ( rc != LDAP_SUCCESS ) {
-        break;
-      }
-
-      /* FIXME: what should we do with the refreshDelete? */
-      switch ( refreshDeletes ) {
-      case 0:
-        c->refreshPhase = LDAP_SYNC_CAPI_PRESENTS;
-        break;
-
-      default:
-        c->refreshPhase = LDAP_SYNC_CAPI_DELETES;
-        break;
-      }
-
-    } /* fallthru */
-
-    case LDAP_SYNC_REFRESH_REQUIRED:
-      /* TODO: check for Sync Done Control */
-      /* FIXME: perhaps the handler should be called
-       * also in case of failure; we'll deal with this
-       * later when implementing refreshOnly */
-      {
-        Handle<Value> args[3];
-
-        args[0] = symbol_syncnewcookie;
-        args[1] = cookie.bv_len?String::New(cookie.bv_val):Undefined();;
-        EMIT(c, 2, args);
-
-        args[0] = symbol_syncresult;
-        args[1] = c->parseReply(c, res);
-        args[2] = Integer::New(c->refreshPhase);
-        EMIT(c, 3, args);
-      }
-      break;
-    }
-
-  done:;
-    if ( matched != NULL ) {
-      ldap_memfree( matched );
-    }
-
-    if ( msg != NULL ) {
-      ldap_memfree( msg );
-    }
-
-    if ( ctrls != NULL ) {
-      ldap_controls_free( ctrls );
-    }
-
-    c->refreshPhase = LDAP_SYNC_CAPI_DONE;
-
-    return rc;
+    Handle<Value> args[2];
+
+    // parseReply will pull the UUID and state out for us.
+
+    args[0] = symbol_syncentry;
+    args[1] = c->parseReply(c, res);
+    EMIT(c, 2, args);
+
+    return 0;
   }

   static int sync_search_intermediate( LDAPConnection * c, LDAPMessage * res, int * refreshDone ) {
@@ -1042,10 +883,11 @@
     BerElement		*ber = NULL;
     ber_len_t		len;
     ber_tag_t		syncinfo_tag;
-    struct berval		cookie = { 0 };
     int			refreshDeletes = 0;
     BerVarray		syncUUIDs = NULL;
-    ldap_sync_refresh_t	phase;
+
+    struct berval cookie = { 0 };
+    ber_int_t RD;

     *refreshDone = 0;

@@ -1069,128 +911,73 @@
     }

     syncinfo_tag = ber_peek_tag( ber, &len );
-    switch ( syncinfo_tag ) {
+
+    switch (syncinfo_tag) {
     case LDAP_TAG_SYNC_NEW_COOKIE:
-      if ( ber_scanf( ber, "m", &cookie ) == LBER_ERROR ) {
+      if ( ber_scanf( ber, /*"{"*/ "m}", &cookie ) == LBER_ERROR ) {
         goto done;
       }
-      {
-        Handle<Value> args[3];
-
-        args[0] = symbol_syncnewcookie;
-        args[1] = cookie.bv_len?String::New(cookie.bv_val):Undefined();;
-        EMIT(c, 2, args);
-
-        args[0] = symbol_syncintermediate;
-        args[1] = Undefined();
-        args[2] = Integer::New(c->refreshPhase);
-        EMIT(c, 3, args);
-      }
+      emitcookie(c, cookie);
       break;
-
     case LDAP_TAG_SYNC_REFRESH_DELETE:
     case LDAP_TAG_SYNC_REFRESH_PRESENT:
-      if ( syncinfo_tag == LDAP_TAG_SYNC_REFRESH_DELETE ) {
-        switch ( c->refreshPhase ) {
-        case LDAP_SYNC_CAPI_NONE:
-        case LDAP_SYNC_CAPI_PRESENTS:
-          c->refreshPhase = LDAP_SYNC_CAPI_DELETES;
-          break;
-
-        default:
-          /* TODO: impossible; handle */
+      if ( ber_scanf( ber, "{" ) == LBER_ERROR ) {
+        goto done;
+      }
+      if (ber_peek_tag(ber, &len) == LDAP_TAG_SYNC_COOKIE) {
+        if (ber_scanf(ber, "m", &cookie) == LBER_ERROR) {
           goto done;
         }
-
+        emitcookie(c, cookie);
+      }
+      if (ber_peek_tag(ber, &len) == LDAP_TAG_REFRESHDONE) {
+        if ( ber_scanf( ber, "b", &RD ) == LBER_ERROR ) {
+          goto done;
+        }
       } else {
-        switch ( c->refreshPhase ) {
-        case LDAP_SYNC_CAPI_NONE:
-          c->refreshPhase = LDAP_SYNC_CAPI_PRESENTS;
-          break;
-
-        default:
-          /* TODO: impossible; handle */
-          goto done;
-        }
-      }
-
+        RD = 1;
+      }
+
+      if (RD) {
+        Handle<Value> args[2];
+        args[0] = symbol_syncrefreshdone;
+        EMIT(c, 1, args);
+      }
+      break;
+
+    case LDAP_TAG_SYNC_ID_SET:
+      // this is a IDSET message
       if ( ber_scanf( ber, "{" /*"}"*/ ) == LBER_ERROR ) {
         goto done;
       }
-      if ( ber_peek_tag( ber, &len ) == LDAP_TAG_SYNC_COOKIE ) {
-        if ( ber_scanf( ber, "m", &cookie ) == LBER_ERROR ) {
+
+      if (ber_peek_tag(ber, &len) == LDAP_TAG_SYNC_COOKIE) {
+        if (ber_scanf(ber, "m", &cookie) == LBER_ERROR) {
           goto done;
         }
-      }
-
-      *refreshDone = 1;
-      if ( ber_peek_tag( ber, &len ) == LDAP_TAG_REFRESHDONE ) {
-        if ( ber_scanf( ber, "b", refreshDone ) == LBER_ERROR ) {
-          goto done;
-        }
-      }
-
-      if ( ber_scanf( ber, /*"{"*/ "}" ) == LBER_ERROR ) {
-        goto done;
-      }
-
-      if ( *refreshDone ) {
-        c->refreshPhase = LDAP_SYNC_CAPI_DONE;
-      }
-
-      {
-        Handle<Value> args[3];
-
-        args[0] = symbol_syncnewcookie;
-        args[1] = cookie.bv_len?String::New(cookie.bv_val):Undefined();;
-        EMIT(c, 2, args);
-
-        args[0] = symbol_syncintermediate;
-        args[1] = c->parseReply(c, res);
-        args[2] = Integer::New(c->refreshPhase);
-        EMIT(c, 3, args);
-
-      }
-      break;
-
-    case LDAP_TAG_SYNC_ID_SET:
-      if ( ber_scanf( ber, "{" /*"}"*/ ) == LBER_ERROR ) {
-        goto done;
-      }
-      if ( ber_peek_tag( ber, &len ) == LDAP_TAG_SYNC_COOKIE ) {
-        if ( ber_scanf( ber, "m", &cookie ) == LBER_ERROR ) {
-          goto done;
-        }
+        emitcookie(c, cookie);
       }

       if ( ber_peek_tag( ber, &len ) == LDAP_TAG_REFRESHDELETES ) {
         if ( ber_scanf( ber, "b", &refreshDeletes ) == LBER_ERROR ) {
           goto done;
         }
+      } else {
+        refreshDeletes = 0;
       }

       if ( ber_scanf( ber, /*"{"*/ "[W]}", &syncUUIDs ) == LBER_ERROR || syncUUIDs == NULL ) {
-          goto done;
-      }
-
-      if ( refreshDeletes ) {
-        phase = LDAP_SYNC_CAPI_DELETES_IDSET;
-      } else {
-        phase = LDAP_SYNC_CAPI_PRESENTS_IDSET;
-      }
-
+        goto done;
+      }
+
+      refreshDeletes = refreshDeletes?1:0;
       {
-        Handle<Value> args[4];
-
-        args[0] = symbol_syncnewcookie;
-        args[1] = cookie.bv_len?String::New(cookie.bv_val):Undefined();;
-        EMIT(c, 2, args);
-
-        args[0] = symbol_syncidset;
-        args[1] = c->parseReply(c, res);
-        args[2] = c->uuid2array(syncUUIDs);
-        args[3] = Integer::New(phase);
-        EMIT(c, 4, args);
+        Handle<Value> args[3];
+
+        args[0] = symbol_syncrefresh;
+        args[1] = c->uuid2array(syncUUIDs);
+        args[2] = Integer::New(refreshDeletes);
+        EMIT(c, 3, args);
       }

       ber_bvarray_free( syncUUIDs );
@@ -1200,6 +987,8 @@
       goto done;

     } // switch( syncinfo_tag)
+
+

     rc = LDAP_SUCCESS;

@@ -1219,9 +1008,127 @@
     return rc;
   }

-
-
-
+  static int sync_search_result( LDAPConnection * c, LDAPMessage *res ) {
+    int	err;
+    char *matched = NULL, *msg = NULL;
+    LDAPControl	**ctrls = NULL;
+    int	rc;
+    int	refreshDeletes = -1;
+
+
+    // since we're not (yet) implementing refreshOnly, I don't think this will
+    // happen... I'm going to assert this and see what happens...
+    assert(0);
+
+    /* should not happen in refreshAndPersist... */
+    rc = ldap_parse_result( c->ld, res, &err, &matched, &msg, NULL, &ctrls, 0 );
+    if ( rc == LDAP_SUCCESS ) {
+      rc = err;
+    }
+
+    c->refreshPhase = LDAP_SYNC_CAPI_DONE;
+
+    switch ( rc ) {
+    case LDAP_SUCCESS: {
+      int		i;
+      BerElement	*ber = NULL;
+      ber_len_t	len;
+
+      rc = LDAP_OTHER;
+
+      /* deal with control; then fallthru to handler */
+      if ( ctrls == NULL ) {
+        goto done;
+      }
+
+      /* lookup the sync state control */
+      for ( i = 0; ctrls[ i ] != NULL; i++ ) {
+        if ( strcmp( ctrls[ i ]->ldctl_oid, LDAP_CONTROL_SYNC_DONE ) == 0 )          {
+            break;
+        }
+      }
+
+      /* control must be present; there might be other... */
+      if ( ctrls[ i ] == NULL ) {
+        goto done;
+      }
+
+      /* extract data */
+      ber = ber_init( &ctrls[ i ]->ldctl_value );
+      if ( ber == NULL ) {
+        goto done;
+      }
+
+      if ( ber_scanf( ber, "{" /*"}"*/) == LBER_ERROR ) {
+        goto ber_done;
+      }
+
+      refreshDeletes = 0;
+      if ( ber_peek_tag( ber, &len ) == LDAP_TAG_REFRESHDELETES ) {
+        if ( ber_scanf( ber, "b", &refreshDeletes ) == LBER_ERROR ) {
+          goto ber_done;
+        }
+        if ( refreshDeletes ) {
+          refreshDeletes = 1;
+        }
+      }
+
+      if ( ber_scanf( ber, /*"{"*/ "}" ) != LBER_ERROR ) {
+        rc = LDAP_SUCCESS;
+      }
+
+      ber_done:;
+      ber_free( ber, 1 );
+      if ( rc != LDAP_SUCCESS ) {
+        break;
+      }
+
+      /* FIXME: what should we do with the refreshDelete? */
+      switch ( refreshDeletes ) {
+      case 0:
+        c->refreshPhase = LDAP_SYNC_CAPI_PRESENTS;
+        break;
+
+      default:
+        c->refreshPhase = LDAP_SYNC_CAPI_DELETES;
+        break;
+      }
+
+    } /* fallthru */
+
+    case LDAP_SYNC_REFRESH_REQUIRED:
+      /* TODO: check for Sync Done Control */
+      /* FIXME: perhaps the handler should be called
+       * also in case of failure; we'll deal with this
+       * later when implementing refreshOnly */
+      {
+        //        Handle<Value> args[3];
+
+        //        args[0] = symbol_syncresult;
+        //        args[1] = c->parseReply(c, res);
+        //        args[2] = Integer::New(c->refreshPhase);
+        //        EMIT(c, 3, args);
+      }
+      break;
+    }
+
+  done:;
+    if ( matched != NULL ) {
+      ldap_memfree( matched );
+    }
+
+    if ( msg != NULL ) {
+      ldap_memfree( msg );
+    }
+
+    if ( ctrls != NULL ) {
+      ldap_controls_free( ctrls );
+    }
+
+    c->refreshPhase = LDAP_SYNC_CAPI_DONE;
+
+    return rc;
+  }

 };


cppcheck: variable reassigned before the old value has been used

For more details, see http://nabble.documentfoundation.org/Cppcheck-redundantAssignment-gridcell-cxx-svx-module-td4095032.html

Change-Id: I9b74a819a1431f5eada727d14933133fbdf7a47f

--- svx/source/fmcomp/gridcell.cxx
+++ svx/source/fmcomp/gridcell.cxx
@@ -2145,8 +2145,6 @@
                 if ( !_rxField->wasNull() )
                 {
                     _rField.SetValue( fValue );
-                    BigInt aValue = _rField.GetCorrectedValue();
-                    sValue = aValue.GetString();
                     sValue = _rField.GetText();
                 }
             }


bugfix: coinbase output addresses not getting indexed.

--- src/blockchain/bdb/bdb_common.cpp
+++ src/blockchain/bdb/bdb_common.cpp
@@ -107,17 +107,17 @@
     // Checks for duplicates first
     if (db_txs_->put(txn->get(), key.get(), value.get(), DB_NOOVERWRITE) != 0)
         return false;
-    if (is_coinbase(block_tx))
-        return true;
-    for (uint32_t input_index = 0; input_index < block_tx.inputs.size();
-        ++input_index)
-    {
-        const message::transaction_input& input =
-            block_tx.inputs[input_index];
-        const message::input_point inpoint{tx_hash, input_index};
-        if (!mark_spent_outputs(txn, input.previous_output, inpoint))
-            return false;
-    }
+    // Coinbase inputs do not spend anything.
+    if (!is_coinbase(block_tx))
+        for (uint32_t input_index = 0; input_index < block_tx.inputs.size();
+            ++input_index)
+        {
+            const message::transaction_input& input =
+                block_tx.inputs[input_index];
+            const message::input_point inpoint{tx_hash, input_index};
+            if (!mark_spent_outputs(txn, input.previous_output, inpoint))
+                return false;
+        }
     for (uint32_t output_index = 0; output_index < block_tx.outputs.size();
         ++output_index)
     {


added: Memory Mapped String

added: Memory Mapped String

git-svn-id: a7f2a8f7432d210e972fb03898013d213e2b549b@2492 e6417c60-b987-48fd-844e-b20f0fcc1017

--- seqan/projects/library/demos/file_speed.cpp
+++ seqan/projects/library/demos/file_speed.cpp
@@ -1,9 +1,9 @@
 #define SEQAN_PROFILE
+//#define SEQAN_DEBUG

-#include <iostream>
 #include <seqan/sequence.h>
 #include <seqan/file.h>
-#include <seqan/system.h>
+#include <iostream>

 using namespace seqan;
 using namespace std;
@@ -11,8 +11,8 @@
 const int blockSize = 1 << 12;
 const int repeats = 1 << 17;

-char block1[blockSize] = "This a test string";
-char block2[blockSize];
+CharString block1 = "This a test string";
+CharString block2;

 template <typename TFile>
 void testThroughput(const char *fileName)
@@ -27,12 +27,14 @@

 	SEQAN_PROTIMESTART(iotime);

-	for (unsigned i = 0; i < repeats; ++i)
+	awriteAt(myFile, toCString(block1), blockSize, 0 * blockSize, req1);
+	awriteAt(myFile, toCString(block2), blockSize, 1 * blockSize, req2);
+	for (unsigned i = 1; i < repeats; ++i)
 	{
 		waitFor(req1);
-		awriteAt(myFile, block1, blockSize,    2*i  * blockSize, req1);
+		awriteAt(myFile, toCString(block1), blockSize,    2*i  * blockSize, req1);
 		waitFor(req2);
-		awriteAt(myFile, block2, blockSize, (2*i+1) * blockSize, req2);
+		awriteAt(myFile, toCString(block2), blockSize, (2*i+1) * blockSize, req2);
 	}
 	waitFor(req1);
 	waitFor(req2);
@@ -43,10 +45,60 @@
 	close(myFile);
 }

+template <typename TFile>
+void testExtString(const char *fileName)
+{
+	String<char, External<ExternalConfig<TFile> > > myString;
+
+	if (!open(myString, fileName, OPEN_WRONLY | OPEN_CREATE)) {
+		cout << "Could not open for writing" << endl;
+		return;
+	}
+
+	SEQAN_PROTIMESTART(iotime);
+
+	for (unsigned i = 0; i < repeats; ++i)
+	{
+		append(myString, block1);
+		append(myString, block2);
+	}
+
+	cout << ((repeats*blockSize / (512.0 * 1024.0)) / SEQAN_PROTIMEDIFF(iotime));
+	cout << " MB/s" << endl;
+}
+
+template <typename TFile>
+void testMMapString(const char *fileName)
+{
+	String<char, MMap<ExternalConfig<TFile> > > myString;
+
+	if (!open(myString, fileName, OPEN_RDWR | OPEN_CREATE)) {
+		cout << "Could not open for writing" << endl;
+		return;
+	}
+
+	SEQAN_PROTIMESTART(iotime);
+
+	for (unsigned i = 0; i < repeats; ++i)
+	{
+		append(myString, block1);
+		append(myString, block2);
+	}
+
+	cout << ((repeats*blockSize / (512.0 * 1024.0)) / SEQAN_PROTIMEDIFF(iotime));
+	cout << " MB/s" << endl;
+}
+
 int main()
 {
-	testThroughput< FILE* >("file_speedF.bin");
-	testThroughput< File< Sync<> > >("file_speedS.bin");
-	testThroughput< File< Async<> > >("file_speedA.bin");
+	resize(block1, blockSize);
+	resize(block2, blockSize);
+	cout << "awrite() using FILE*        ";		testThroughput< FILE* >				("file_speed1.bin");
+	cout << "awrite() using sync. File   ";		testThroughput< File< Sync<> > >	("file_speed2.bin");
+	cout << "awrite() using async. File  ";		testThroughput< File< Async<> > >	("file_speed3.bin");
+	cout << "ExtString using FILE*       ";		testExtString< FILE* >				("file_speed4.bin");
+	cout << "ExtString using sync. File  ";		testExtString< File< Sync<> > >		("file_speed5.bin");
+	cout << "ExtString using async. File ";		testExtString< File< Async<> > >	("file_speed6.bin");
+	cout << "Memory Mapped String        ";		testMMapString< File< Sync<> > >	("file_speed7.bin");
 	return 0;
 }


INTEGRATION: CWS presfixes09 (1.3.18); FILE MERGED 2006/04/12 20:40:09 thb 1.3.18.3: #i37778# Replaced all shared_ptr.get() != NULL places with the more elegant automatic-conversion-to-bool version (at least where the compiler tolerated that) 2006/03/24 18:23:36 thb 1.3.18.2: #i37778# Moved whole slideshow engine from namespace presentation (which conflicts with one of the UNO subnamespaces) to slideshow 2006/03/23 17:22:45 thb 1.3.18.1: #i49357# Changed manual noncopyable boiler plate to boost::noncopyable

--- slideshow/source/inc/shapeattributelayerholder.hxx
+++ slideshow/source/inc/shapeattributelayerholder.hxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: shapeattributelayerholder.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.4 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-07 21:18:09 $
+ *  last change: $Author: kz $ $Date: 2006-12-13 16:01:42 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -39,8 +39,9 @@
 #include <attributableshape.hxx>
 #include <shapeattributelayer.hxx>

+#include <boost/utility.hpp>

-namespace presentation
+namespace slideshow
 {
     namespace internal
     {
@@ -54,7 +55,7 @@
             process that is required for shape and attribute layer
             interaction).
          */
-        class ShapeAttributeLayerHolder
+        class ShapeAttributeLayerHolder : private boost::noncopyable
         {
         public:
             /** Create a ShapeAttributeLayerHolder instance.
@@ -77,7 +78,7 @@

             void reset()
             {
-                if( mpShape.get() && mpAttributeLayer.get() )
+                if( mpShape && mpAttributeLayer )
                     mpShape->revokeAttributeLayer( mpAttributeLayer );
             }

@@ -95,10 +96,10 @@

                 mpShape = rShape;

-                if( mpShape.get() )
+                if( mpShape )
                     mpAttributeLayer = mpShape->createAttributeLayer();

-                return mpAttributeLayer.get() != NULL;
+                return mpAttributeLayer;
             }

             ShapeAttributeLayerSharedPtr get() const
@@ -107,10 +108,6 @@
             }

         private:
-            // default: disabled copy/assignment
-            ShapeAttributeLayerHolder(const ShapeAttributeLayerHolder&);
-            ShapeAttributeLayerHolder& operator=( const ShapeAttributeLayerHolder& );
-
             AttributableShapeSharedPtr      mpShape;
             ShapeAttributeLayerSharedPtr    mpAttributeLayer;
         };


[Cache] Updated OpenMP and CUDA, still need to test [4]

--- src/occaOpenMP.cpp
+++ src/occaOpenMP.cpp
@@ -52,8 +52,8 @@
       const std::string testFilename = (testDir  + "ompTest.cpp");
       const std::string infoFilename = (testDir  + "ompTestFor_" + safeCompiler);

-      if(!haveFile(testFilename)){
-        waitForFile(testFilename);
+      if(!haveHash(hash)){
+        waitForHash(hash);
       }
       else{
         if(!sys::fileExists(testFilename)){


use getChar

use getChar

svn path=/trunk/kdesupport/qca/; revision=678666

--- tools/qcatool/main.cpp
+++ tools/qcatool/main.cpp
@@ -269,10 +269,10 @@
 	void start()
 	{
 		// user can quit the monitoring by pressing enter
-		printf("Monitoring keystores, press Enter to quit.\n");
+		printf("Monitoring keystores, press 'q' to quit.\n");
 		prompt = new QCA::ConsolePrompt(this);
 		connect(prompt, SIGNAL(finished()), SLOT(prompt_finished()));
-		prompt->getEnter();
+		prompt->getChar();

 		// kick off the subsystem
 		QCA::KeyStoreManager::start();
@@ -312,7 +312,13 @@

 	void prompt_finished()
 	{
-		eventLoop->exit();
+		QChar c = prompt->resultChar();
+		if(c == 'q' || c == 'Q')
+		{
+			eventLoop->exit();
+			return;
+		}
+		prompt->getChar();
 	}
 };

@@ -338,6 +344,7 @@
 	int prompt_id;
 	QCA::Event prompt_event;
 	QList<Item> pending;
+	bool auto_accept;

 	QCA::KeyStoreManager ksm;
 	QList<QCA::KeyStore*> keyStores;
@@ -347,6 +354,7 @@
 		allowPrompt = true;
 		warned = false;
 		have_pass = false;
+		auto_accept = false;

 		prompt = 0;

@@ -487,7 +495,7 @@
 				name = QString("the '") + e.keyStoreInfo().name() + "' token";
 			}

-			QString str = QString("Please insert %1 and press Enter ...").arg(name);
+			QString str = QString("Please insert %1 and press Enter (or 'q' to cancel) ...").arg(name);

 			if(!prompt)
 			{
@@ -496,7 +504,7 @@
 				connect(prompt, SIGNAL(finished()), SLOT(prompt_finished()));
 				prompt_id = id;
 				prompt_event = e;
-				prompt->getEnter();
+				prompt->getChar();
 			}
 			else
 			{
@@ -514,9 +522,31 @@
 	void prompt_finished()
 	{
 		if(prompt_event.type() == QCA::Event::Password)
+		{
 			handler.submitPassword(prompt_id, prompt->result());
+		}
 		else
-			handler.tokenOkay(prompt_id);
+		{
+			if(auto_accept)
+			{
+				auto_accept = false;
+				handler.tokenOkay(prompt_id);
+			}
+			else
+			{
+				QChar c = prompt->resultChar();
+				if(c == '\r' || c == '\n')
+					handler.tokenOkay(prompt_id);
+				else if(c == 'q' || c == 'Q')
+					handler.reject(prompt_id);
+				else
+				{
+					// retry
+					prompt->getChar();
+					return;
+				}
+			}
+		}

 		if(!pending.isEmpty())
 		{
@@ -530,7 +560,7 @@
 			else // Token
 			{
 				fprintf(stderr, "%s\n", qPrintable(i.promptStr));
-				prompt->getEnter();
+				prompt->getChar();
 			}
 		}
 		else
@@ -555,6 +585,7 @@
 				fprintf(stderr, "Token inserted!  Continuing...\n");

 				// auto-accept
+				auto_accept = true;
 				prompt_finished();
 			}
 		}


INTEGRATION: CWS ooo19126 (1.18.78); FILE MERGED 2005/09/05 14:27:05 rt 1.18.78.1: #i54170# Change license header: remove SISSL

--- svx/source/svdraw/svdedtv2.cxx
+++ svx/source/svdraw/svdedtv2.cxx
@@ -1,61 +1,35 @@
 /*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
  *
  *  $RCSfile: svdedtv2.cxx,v $
  *
- *  $Revision: 1.18 $
+ *  $Revision: 1.19 $
  *
- *  last change: $Author: obo $ $Date: 2005-07-22 09:19:34 $
+ *  last change: $Author: rt $ $Date: 2005-09-09 00:25:56 $
  *
- *  The Contents of this file are made available subject to the terms of
- *  either of the following licenses
- *
- *         - GNU Lesser General Public License Version 2.1
- *         - Sun Industry Standards Source License Version 1.1
- *
- *  Sun Microsystems Inc., October, 2000
- *
- *  GNU Lesser General Public License Version 2.1
- *  =============================================
- *  Copyright 2000 by Sun Microsystems, Inc.
- *  901 San Antonio Road, Palo Alto, CA 94303, USA
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License version 2.1, as published by the Free Software Foundation.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *  MA  02111-1307  USA
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
  *
  *
- *  Sun Industry Standards Source License Version 1.1
- *  =================================================
- *  The contents of this file are subject to the Sun Industry Standards
- *  Source License Version 1.1 (the "License"); You may not use this file
- *  except in compliance with the License. You may obtain a copy of the
- *  License at http://www.openoffice.org/license.html.
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 by Sun Microsystems, Inc.
+ *    901 San Antonio Road, Palo Alto, CA 94303, USA
  *
- *  Software provided under this License is provided on an "AS IS" basis,
- *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
- *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
- *  See the License for the specific provisions governing your rights and
- *  obligations concerning the Software.
+ *    This library is free software; you can redistribute it and/or
+ *    modify it under the terms of the GNU Lesser General Public
+ *    License version 2.1, as published by the Free Software Foundation.
  *
- *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *    This library is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ *    Lesser General Public License for more details.
  *
- *  Copyright: 2000 by Sun Microsystems, Inc.
- *
- *  All Rights Reserved.
- *
- *  Contributor(s): _______________________________________
- *
+ *    You should have received a copy of the GNU Lesser General Public
+ *    License along with this library; if not, write to the Free Software
+ *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ *    MA  02111-1307  USA
  *
  ************************************************************************/


[Parser] setupOccaFors: Fixed info extractin

--- src/occaParser.cpp
+++ src/occaParser.cpp
@@ -988,8 +988,6 @@
       expNode &node2 = *(s.expRoot.leaves[1]);
       expNode &node3 = *(s.expRoot.leaves[2]);

-      node1.print();
-
       //---[ Node 1 ]---------
       if((node1.info != expType::declaration) ||
          (node1.getVariableCount() != 1)      ||
@@ -1003,39 +1001,39 @@

       //---[ Node 2 ]---------
       if((node2.leafCount != 1) ||
-         ((node2.leaves[0]->value != "<=") &&
-          (node2.leaves[0]->value != "<" ) &&
-          (node2.leaves[0]->value != ">" ) &&
-          (node2.leaves[0]->value != ">="))){
+         ((node2[0].value != "<=") &&
+          (node2[0].value != "<" ) &&
+          (node2[0].value != ">" ) &&
+          (node2[0].value != ">="))){

         std::cout << "Wrong 2nd statement for:\n  " << s.expRoot << '\n';
         throw 1;
       }

-      if(node2.leaves[0]->leaves[0]->value == iter){
-        bound = (std::string) *(node2.leaves[0]->leaves[1]);
-      }
-      else if(node2.leaves[0]->leaves[1]->value == iter){
-        bound = (std::string) *(node2.leaves[0]->leaves[0]);
+      if(node2[0][0].value == iter){
+        bound = (std::string) node2[0][1];
+      }
+      else if(node2[0][1].value == iter){
+        bound = (std::string) node2[0][0];
       }
       else {
         std::cout << "Wrong 2nd statement for:\n  " << s.expRoot << '\n';
         throw 1;
       }

-      iterCheck = node2.leaves[0]->value;
+      iterCheck = node2[0].value;

       //---[ Node 3 ]---------
       if((node3.leafCount != 1) ||
-         ((node3.leaves[0]->value != "++") &&
-          (node3.leaves[0]->value != "--") &&
-          (node3.leaves[0]->value != "+=") &&
-          (node3.leaves[0]->value != "-="))){
+         ((node3[0].value != "++") &&
+          (node3[0].value != "--") &&
+          (node3[0].value != "+=") &&
+          (node3[0].value != "-="))){
         std::cout << "Wrong 3nd statement for:\n  " << s.expRoot << '\n';
         throw 1;
       }

-      iterOp = node3.leaves[0]->value;
+      iterOp = node3[0].value;

       // [+]+, [+]=
       // [-]-, [-]=
@@ -1044,11 +1042,11 @@
       if((iterOp == "++") || (iterOp == "--"))
         opStride = "1";
       else{
-        if(node3.leaves[0]->leaves[0]->value == iter){
-          opStride = (std::string) *(node3.leaves[0]->leaves[1]);
-        }
-        else if(node3.leaves[0]->leaves[1]->value == iter){
-          opStride = (std::string) *(node3.leaves[0]->leaves[0]);
+        if(node3[0][0].value == iter){
+          opStride = (std::string) node3[0][1];
+        }
+        else if(node3[0][1].value == iter){
+          opStride = (std::string) node3[0][0];
         }
         else {
           std::cout << "Wrong 3rd statement for:\n  " << s.expRoot << '\n';


Removed one compiler warning in Ln 570

Removed one compiler warning in Ln 570

--- svx/source/svdraw/svdlayer.cxx
+++ svx/source/svdraw/svdlayer.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: svdlayer.cxx,v $
  *
- *  $Revision: 1.4 $
- *
- *  last change: $Author: aw $ $Date: 2002-03-11 15:31:00 $
+ *  $Revision: 1.5 $
+ *
+ *  last change: $Author: aw $ $Date: 2002-03-11 15:34:11 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -567,7 +567,7 @@
     sal_Int32 j;
     for (j=0; j<GetLayerCount(); j++)
     {
-        aSet.Set(GetLayer(j)->GetID());
+        aSet.Set(GetLayer((sal_uInt16)j)->GetID());
     }
     SdrLayerID i;
     if (!bDown)


fdo#47434: Zero rect. size causing wrong line positions.

Thanks to Korrawit Pruegsanusak <detective.conan.1412@gmail.com>
for the indepth analysis and debugging.

--- svx/source/svdraw/svdoashp.cxx
+++ svx/source/svdraw/svdoashp.cxx
@@ -3026,6 +3026,10 @@
     // build and set BaseRect (use scale)
     Point aPoint = Point();
     Size aSize(FRound(aScale.getX()), FRound(aScale.getY()));
+    // fdo#47434 We need a valid rectangle here
+    if( !aSize.Height() ) aSize.setHeight( 1 );
+    if( !aSize.Width() ) aSize.setWidth( 1 );
+
     Rectangle aBaseRect(aPoint, aSize);
     SetSnapRect(aBaseRect);


Operation Functions

Operation Functions

I wasn't too sure about the boolean addition, so I've left that alone.

--- src/operations.cpp
+++ src/operations.cpp
@@ -44,5 +44,42 @@
 	return priority(a.value()) - priority(b.value());
 }

+Token Operations::add(Token t1, Token t2) {
+    if(t1.subtype() != t2.subtype() ) return nullToken;
+    if(t1.subtype() == NUMBER) {
+        long a1 = t1.value().toNumber(),a2 = t2.value().toNumber();
+        return Lexer::toToken(numberToString(a1 + a2));
+    }
+    if(t1.subtype() == STRING) {
+        String s1 = Lexer::tokenToString(t1),s2 = Lexer::tokenToString(t2);
+        return Lexer::toToken(s1 + s2);
+    }
+}
+
+Token Operations::subtract(Token t1, Token t2) {
+    if(t1.subtype() != NUMBER && t2.subtype() != NUMBER) return nullToken;
+    long a1 = t1.value().toNumber(),a2 = t2.value().toNumber();
+    return Lexer::toToken(numberToString(a1 - a2));
+}
+
+Token Operations::multiply(Token t1, Token t2) {
+    if(t1.subtype() != NUMBER && t2.subtype() != NUMBER) return nullToken;
+    long a1 = t1.value().toNumber(),a2 = t2.value().toNumber();
+    return Lexer::toToken(numberToString(a1 * a2));
+}
+
+Token Operations::divide(Token t1, Token t2) {
+    if(t1.subtype() != NUMBER && t2.subtype() != NUMBER) return nullToken;
+    long a1 = t1.value().toNumber(),a2 = t2.value().toNumber();
+    return Lexer::toToken(numberToString(a1 / a2));
+}
+
+Token Operations::modulo(Token t1, Token t2) {
+    if((!t1.value().isInteger()) && (!t2.value().isInteger())) return nullToken;
+    long a1 = t1.value().toNumber(),a2 = t2.value().toNumber();
+    return Lexer::toToken(integerToString(a1 / a2));
+}
+
+
 #endif /* COMPONENT_PARSER_OPERATION_H */
 #endif /* COMPONENT_PARSER_H */


Boolean uniforms are now updatable by properties

--- simgear/scene/material/Effect.cxx
+++ simgear/scene/material/Effect.cxx
@@ -961,6 +961,11 @@
         uniform->setName(name);
         uniform->setType(uniformType);
         switch (uniformType) {
+        case Uniform::BOOL:
+            initFromParameters(effect, valProp, uniform.get(),
+                               static_cast<bool (Uniform::*)(bool)>(&Uniform::set),
+                               options);
+            break;
         case Uniform::FLOAT:
             initFromParameters(effect, valProp, uniform.get(),
                                static_cast<bool (Uniform::*)(float)>(&Uniform::set),


fix saslComplete crash

fix saslComplete crash

Summary: Stack trace P19871211 seems to point to a missing dg here

Test Plan: ?? maybe @adin can test it?  It seems like a convoluted case - sasl handshake half complete, then finishes, but the initial read fails

Reviewed By: mcduff@fb.com

Subscribers: sjenkins, alandau, bmatheny, yfeldblum, adin

FB internal diff: D2144676

Tasks: 7370887

Signature: t1:2144676:1433968001:db88be690685c070232661cd38853b4077df72e5

--- thrift/lib/cpp2/async/HeaderServerChannel.cpp
+++ thrift/lib/cpp2/async/HeaderServerChannel.cpp
@@ -550,6 +550,9 @@
 }

 void HeaderServerChannel::SaslServerCallback::saslComplete() {
+  // setProtectionState could eventually destroy the channel
+  DestructorGuard dg(&channel_);
+
   const auto& observer = std::dynamic_pointer_cast<TServerObserver>(
     channel_.getEventBase()->getObserver());


INTEGRATION: CWS changefileheader (1.8.620); FILE MERGED 2008/04/01 15:51:46 thb 1.8.620.3: #i85898# Stripping all external header guards 2008/04/01 12:50:07 thb 1.8.620.2: #i85898# Stripping all external header guards 2008/03/31 14:24:03 rt 1.8.620.1: #i87441# Change license header to LPGL v3.

--- svx/source/svxlink/fileobj.hxx
+++ svx/source/svxlink/fileobj.hxx
@@ -1,53 +1,39 @@
 /*************************************************************************
  *
- *  OpenOffice.org - a multi-platform office productivity suite
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
- *  $RCSfile: fileobj.hxx,v $
+ * Copyright 2008 by Sun Microsystems, Inc.
  *
- *  $Revision: 1.8 $
+ * OpenOffice.org - a multi-platform office productivity suite
  *
- *  last change: $Author: vg $ $Date: 2006-11-22 10:37:29 $
+ * $RCSfile: fileobj.hxx,v $
+ * $Revision: 1.9 $
  *
- *  The Contents of this file are made available subject to
- *  the terms of GNU Lesser General Public License Version 2.1.
+ * This file is part of OpenOffice.org.
  *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
  *
- *    GNU Lesser General Public License Version 2.1
- *    =============================================
- *    Copyright 2005 by Sun Microsystems, Inc.
- *    901 San Antonio Road, Palo Alto, CA 94303, USA
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
  *
- *    This library is free software; you can redistribute it and/or
- *    modify it under the terms of the GNU Lesser General Public
- *    License version 2.1, as published by the Free Software Foundation.
- *
- *    This library is distributed in the hope that it will be useful,
- *    but WITHOUT ANY WARRANTY; without even the implied warranty of
- *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *    Lesser General Public License for more details.
- *
- *    You should have received a copy of the GNU Lesser General Public
- *    License along with this library; if not, write to the Free Software
- *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- *    MA  02111-1307  USA
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org.  If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
  *
  ************************************************************************/
 #ifndef _FILEOBJ_HXX
 #define _FILEOBJ_HXX

-#ifndef _STRING_HXX //autogen
 #include <tools/string.hxx>
-#endif
-#ifndef _LINKSRC_HXX //autogen
 #include <sfx2/linksrc.hxx>
-#endif
-#ifndef _SFXDOCFILE_HXX //autogen
 #include <sfx2/docfile.hxx>
-#endif
-
-#ifndef _SVXLINKMGR_HXX
 #include "linkmgr.hxx"
-#endif

 class Graphic;
 struct Impl_DownLoadData;


Fixed incorrect swatch widget drawing in new cairo versions.

--- source/gtk/Swatch.cpp
+++ source/gtk/Swatch.cpp
@@ -239,6 +239,7 @@
 		gtk_swatch_draw_hexagon(cr, radius_multi * cos(rotation + i * (2 * PI) / edges), radius_multi * sin(rotation + i * (2 * PI) / edges), 27);
 	}

+	cairo_set_line_join(cr, CAIRO_LINE_JOIN_ROUND);
 	cairo_stroke(cr);

 	cairo_set_source_rgb(cr, 1, 1, 1);


Fixed a small oversight in the previous bug fix.  in GeoSet::computeBound() _numcoords is NOT necesarily _cindex._size.

--- src/osg/GeoSet.cpp
+++ src/osg/GeoSet.cpp
@@ -434,7 +434,7 @@
     {
         if( _cindex.valid() )
 	{
-            for( i = 0; i < _numcoords; i++ )
+            for( i = 0; i < int(_cindex._size); i++ )
             {
                 center += _coords[_cindex[i]];
                 _bbox.expandBy(_coords[_cindex[i]]);


Nog een poging...

Nog een poging...

--- Connector_RTMP/main.cpp
+++ Connector_RTMP/main.cpp
@@ -1,4 +1,4 @@
-#undef DEBUG
+#define DEBUG
 #include <iostream>
 #include <cstdlib>
 #include <cstdio>
@@ -65,8 +65,8 @@
   #ifdef DEBUG
   fprintf(stderr, "Starting processing...\n");
   #endif
-  while (!ferror(stdin) && !ferror(stdout)){
-    //only parse input from stdin if available or not yet init'ed
+  while (!ferror(CONN)){
+    //only parse input if available or not yet init'ed
     //rightnow = getNowMS();
     if ((!ready4data || (snd_cnt - snd_window_at >= snd_window_size)) && !stopparsing){
       parseChunk();


Frederic Bouvier:

Frederic Bouvier:

I modified the included animation.cxx to have a randomly displaced
time origin, to break the unison. And the flashing period is also
random as you noticed. I also put all the flashing light of the pole
in the same animation so they flash in the same rhythm.

--- simgear/scene/model/animation.cxx
+++ simgear/scene/model/animation.cxx
@@ -428,12 +428,26 @@
 SGTimedAnimation::SGTimedAnimation (SGPropertyNode_ptr props)
   : SGAnimation(props, new ssgSelector),
     _use_personality( props->getBoolValue("use-personality",false) ),
-    _duration_sec(props->getDoubleValue("duration-sec", 1.0)),
-    _last_time_sec( sim_time_sec ),
     _total_duration_sec( 0 ),
     _step( 0 )

 {
+    SGPropertyNode_ptr dNode = props->getChild( "duration-sec" );
+    if ( dNode == 0 ) {
+        _duration_sec = 1.0;
+    } else {
+        SGPropertyNode_ptr rNode = dNode->getChild("random");
+        if ( rNode == 0 ) {
+            _duration_sec = dNode->getDoubleValue();
+        } else {
+            double dmin = rNode->getDoubleValue( "min", 0.0 ),
+                   dmax = rNode->getDoubleValue( "max", 1.0 );
+            _duration_sec = dmin + sg_random() * ( dmax - dmin );
+        }
+    }
+
+    _last_time_sec = sim_time_sec - _duration_sec;
+
     vector<SGPropertyNode_ptr> nodes = props->getChildren( "branch-duration-sec" );
     size_t nb = nodes.size();
     for ( size_t i = 0; i < nb; i++ ) {


#83212# added helper functions to force unique names for NameOrIndex items

--- svx/source/unodraw/unoprov.cxx
+++ svx/source/unodraw/unoprov.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: unoprov.cxx,v $
  *
- *  $Revision: 1.18 $
- *
- *  last change: $Author: cl $ $Date: 2001-03-04 22:50:23 $
+ *  $Revision: 1.19 $
+ *
+ *  last change: $Author: cl $ $Date: 2001-03-07 14:28:57 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -808,9 +808,9 @@
         break;

     case XATTR_LINEDASH:
-        nApiResIds = RID_SVXSTR_DASH0_DEF;
-        nIntResIds = RID_SVXSTR_DASH0;
-        nCount = RID_SVXSTR_DASH10_DEF - RID_SVXSTR_DASH0_DEF + 1;
+        nApiResIds = RID_SVXSTR_DASH_DEF_START;
+        nIntResIds = RID_SVXSTR_DASH_START;
+        nCount = RID_SVXSTR_DASH_DEF_END - RID_SVXSTR_DASH_DEF_START + 1;
         break;

     case XATTR_LINESTART:


CornerPin: capitalize UI

CornerPin: capitalize UI

--- CornerPin/CornerPin.cpp
+++ CornerPin/CornerPin.cpp
@@ -104,11 +104,13 @@
 #define kParamCopyInputRoDHint "Copy the values from the source region of definition into the \"to\" points."

 #define kParamOverlayPoints "overlayPoints"
-#define kParamOverlayPointsLabel "Overlay points"
+#define kParamOverlayPointsLabel "Overlay Points"
 #define kParamOverlayPointsHint "Whether to display the \"from\" or the \"to\" points in the overlay"
+#define kParamOverlayPointsOptionTo "To"
+#define kParamOverlayPointsOptionFrom "From"

 #define kGroupExtraMatrix "transformMatrix"
-#define kGroupExtraMatrixLabel "Extra matrix"
+#define kGroupExtraMatrixLabel "Extra Matrix"
 #define kGroupExtraMatrixHint "This matrix gets concatenated to the transform defined by the other parameters."
 #define kParamExtraMatrixRow1 "row1"
 #define kParamExtraMatrixRow2 "row2"
@@ -1152,8 +1154,8 @@
         ChoiceParamDescriptor* param = desc.defineChoiceParam(kParamOverlayPoints);
         param->setLabel(kParamOverlayPointsLabel);
         param->setHint(kParamOverlayPointsHint);
-        param->appendOption("To");
-        param->appendOption("From");
+        param->appendOption(kParamOverlayPointsOptionTo);
+        param->appendOption(kParamOverlayPointsOptionFrom);
         param->setDefault(0);
         param->setEvaluateOnChange(false);
         if (page) {


Fixed call to SA's probability function (sending normalized fitness)

--- simulated_annealing_algorithm.cpp
+++ simulated_annealing_algorithm.cpp
@@ -33,7 +33,8 @@
 	// keep track of best solution
 	if (neighbor > best
 	    // SA swaps in bad solutions with this probability
-	    || probability(best.fitness, neighbor.fitness, temperature)) {
+	    || probability(problem.normal(best), problem.normal(neighbor),
+			   temperature)) {
 	  best = neighbor;
 	  // terminating condition
 	  if (best > problem.goal) return best;


INTEGRATION: CWS gt03 (1.30.68); FILE MERGED 2004/04/20 09:23:43 gt 1.30.68.3: RESYNC: (1.31-1.32); FILE MERGED 2004/03/24 08:27:27 gt 1.30.68.2: RESYNC: (1.30-1.31); FILE MERGED 2004/03/11 14:54:59 fme 1.30.68.1: #26165# Feature - Multiple headline rows in tables

--- sw/source/core/crsr/crsrsh.cxx
+++ sw/source/core/crsr/crsrsh.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: crsrsh.cxx,v $
  *
- *  $Revision: 1.33 $
+ *  $Revision: 1.34 $
  *
- *  last change: $Author: svesik $ $Date: 2004-04-21 09:54:14 $
+ *  last change: $Author: rt $ $Date: 2004-05-03 13:43:13 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -1217,33 +1217,34 @@

         SwTabFrm *pTab = pTblFrm->FindTabFrm(), *pMarkTab;

-        if( pTab && pTab->GetTable()->IsHeadlineRepeat() && (
-            ( pTab->IsFollow() &&
-              ((SwLayoutFrm*)pTab->Lower())->IsAnLower( pTblFrm )) ||
-            ( (pMarkTab = (pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )
-                ->GetFrm( &aTmpMk, pITmpCrsr->GetMark() ))->FindTabFrm())->IsFollow() &&
-                ((SwLayoutFrm*)pMarkTab->Lower())->IsAnLower( pMarkTblFrm )) ))
-        {
-            // in wiederholten Tabellen-Kopfzeilen wollen wir keine
-            // Tabellen-Selektion !!
-            pTblFrm = 0;
-
-            SwPosSection fnPosSect = *pPos <  *pITmpCrsr->GetMark()
-                                        ? fnSectionStart
-                                        : fnSectionEnd;
-
-            // dann nur innerhalb der Box selektieren
-            if( pTblCrsr )
+        if ( pTab && pTab->GetTable()->GetRowsToRepeat() > 0 )
+        {
+            if (  ( pTab->IsFollow() && pTab->IsInHeadline( *pTblFrm ) ) ||
+                  ( (pMarkTab = (pMarkTblFrm = pITmpCrsr->GetCntntNode( FALSE )->
+                    GetFrm( &aTmpMk, pITmpCrsr->GetMark() ))->FindTabFrm())->IsFollow() &&
+                     pMarkTab->IsInHeadline( *pMarkTblFrm ) ) )
             {
-                pCurCrsr->SetMark();
-                *pCurCrsr->GetMark() = *pTblCrsr->GetMark();
-                pCurCrsr->GetMkPos() = pTblCrsr->GetMkPos();
-                pTblCrsr->DeleteMark();
-                pTblCrsr->SwSelPaintRects::Hide();
+                // in wiederholten Tabellen-Kopfzeilen wollen wir keine
+                // Tabellen-Selektion !!
+                pTblFrm = 0;
+
+                SwPosSection fnPosSect = *pPos <  *pITmpCrsr->GetMark()
+                                            ? fnSectionStart
+                                            : fnSectionEnd;
+
+                // dann nur innerhalb der Box selektieren
+                if( pTblCrsr )
+                {
+                    pCurCrsr->SetMark();
+                    *pCurCrsr->GetMark() = *pTblCrsr->GetMark();
+                    pCurCrsr->GetMkPos() = pTblCrsr->GetMkPos();
+                    pTblCrsr->DeleteMark();
+                    pTblCrsr->SwSelPaintRects::Hide();
+                }
+
+                *pCurCrsr->GetPoint() = *pCurCrsr->GetMark();
+                (*fnSectionCurr)( *pCurCrsr, fnPosSect );
             }
-
-            *pCurCrsr->GetPoint() = *pCurCrsr->GetMark();
-            (*fnSectionCurr)( *pCurCrsr, fnPosSect );
         }

         // wir wollen wirklich eine Tabellen-Selektion


Update speed every 20ms

Update speed every 20ms

--- src/pAlgorithm.cpp
+++ src/pAlgorithm.cpp
@@ -18,7 +18,7 @@
 {
 	m_loop.addFunctionToLoop(update, 5);
 	m_loop.addFunctionToLoop(directionControl, 10);
-	m_loop.addFunctionToLoop(speedControl, 100);
+	m_loop.addFunctionToLoop(speedControl, 20);
 	m_loop.addFunctionToLoop(angleControl, 5);
 	m_loop.addFunctionToLoop(print, 20);
 //	m_loop.addFunctionToLoop(safetyCheck, 200);
@@ -115,7 +115,7 @@

 void pSmartCar::updateSmoothAngleOutput(const float newAngle)
 {
-	m_smoothIncrement[IncrementType::SpeedIncrement] = (newAngle - m_idealAngleOffset) * 0.05f;
+	m_smoothIncrement[IncrementType::SpeedIncrement] = (newAngle - m_idealAngleOffset) * 0.25f;
 }

 float pSmartCar::getSmoothAngleOutput(void)


Check that we have a sipXtapi call data pointer before touching it.

git-svn-id: f26ccc5efe72c2bd8e1c40f599fe313f2692e4de@11982 a612230a-c5fa-0310-af8b-88eea846685b

--- sipXcallLib/src/tapi/sipXtapi.cpp
+++ sipXcallLib/src/tapi/sipXtapi.cpp
@@ -2959,33 +2959,41 @@
             memset((void*) pInfoData, 0, sizeof(SIPX_INFO_DATA));
             SIPX_CALL_DATA* pCall = sipxCallLookup(hCall, SIPX_LOCK_READ, stackLogger);

-            pInfoData->pInst = pInst;
-            // Create Mutex
-            pInfoData->pMutex = new OsRWMutex(OsRWMutex::Q_FIFO);
-            pInfoData->infoData.nSize = sizeof(SIPX_INFO_INFO);
-            pInfoData->infoData.hCall = hCall;
-            pInfoData->infoData.hLine = hLine;
-            pInfoData->infoData.szFromURL = strdup(lineId.data());
-            pInfoData->infoData.nContentLength = nContentLength;
-            pInfoData->infoData.szContentType = strdup(szContentType);
-            pInfoData->infoData.pContent = strdup(szContent);
-
-            *phInfo = gpInfoHandleMap->allocHandle(pInfoData) ;
-            assert(*phInfo != 0) ;
-
-            SipSession* pSession = new SipSession(callId, pCall->remoteAddress->data(), pInfoData->infoData.szFromURL);
-            sipxCallReleaseLock(pCall, SIPX_LOCK_READ, stackLogger);
-
-            pInst->pSipUserAgent->addMessageObserver(*(pInst->pMessageObserver->getMessageQueue()), SIP_INFO_METHOD, 0, 1, 1, 0, 0, pSession, (void*)*phInfo);
-            delete pSession;
-
-            if (pInst->pCallManager->sendInfo(callId, remoteAddress, szContentType, nContentLength, szContent))
-            {
-                sr = SIPX_RESULT_SUCCESS ;
+            if(pCall)
+            {
+                pInfoData->pInst = pInst;
+                // Create Mutex
+                pInfoData->pMutex = new OsRWMutex(OsRWMutex::Q_FIFO);
+                pInfoData->infoData.nSize = sizeof(SIPX_INFO_INFO);
+                pInfoData->infoData.hCall = hCall;
+                pInfoData->infoData.hLine = hLine;
+                pInfoData->infoData.szFromURL = strdup(lineId.data());
+                pInfoData->infoData.nContentLength = nContentLength;
+                pInfoData->infoData.szContentType = strdup(szContentType);
+                pInfoData->infoData.pContent = strdup(szContent);
+
+                *phInfo = gpInfoHandleMap->allocHandle(pInfoData) ;
+                assert(*phInfo != 0) ;
+
+                SipSession* pSession = new SipSession(callId, pCall->remoteAddress->data(), pInfoData->infoData.szFromURL);
+                sipxCallReleaseLock(pCall, SIPX_LOCK_READ, stackLogger);
+
+                pInst->pSipUserAgent->addMessageObserver(*(pInst->pMessageObserver->getMessageQueue()), SIP_INFO_METHOD, 0, 1, 1, 0, 0, pSession, (void*)*phInfo);
+                delete pSession;
+
+                if (pInst->pCallManager->sendInfo(callId, remoteAddress, szContentType, nContentLength, szContent))
+                {
+                    sr = SIPX_RESULT_SUCCESS ;
+                }
+                else
+                {
+                    sr = SIPX_RESULT_INVALID_STATE ;
+                }
             }
             else
             {
-                sr = SIPX_RESULT_INVALID_STATE ;
+                // Could not find or lock call object
+                sr = SIPX_RESULT_INVALID_ARGS ;
             }
         }
         else
@@ -4606,12 +4614,15 @@
     if (pData && !pData->strCallId.isNull())
     {
         UtlString callId = pData->strCallId;
-        OsStatus osStatus = pData->pInst->pCallManager->setRtpDestination(callId, connectionId, cpMediaType,
-            mediaTypeStreamIndex, mediaRecieveAddress, rtpPort, rtcpPort);
-
-        if(osStatus == OS_SUCCESS)
-        {
-            status = SIPX_RESULT_SUCCESS;
+        if(!callId.isNull())
+        {
+            OsStatus osStatus = pData->pInst->pCallManager->setRtpDestination(callId, connectionId, cpMediaType,
+                mediaTypeStreamIndex, mediaRecieveAddress, rtpPort, rtcpPort);
+
+            if(osStatus == OS_SUCCESS)
+            {
+                status = SIPX_RESULT_SUCCESS;
+            }
         }
     }
     if(pData)


Fix extension registration crash on Lua 5.2.

Do not depend on luaL_requiref stack usage before openf function is
called, because it is not the same in different Lua versions.

Issue #177.

--- source/lua/Script.cpp
+++ source/lua/Script.cpp
@@ -104,8 +104,11 @@
 }
 static int registerLuaPackage(lua_State *L)
 {
-	auto &script = *reinterpret_cast<Script*>(lua_touserdata(L, -5));
-	auto &extension = *reinterpret_cast<function<int(Script &)>*>(lua_touserdata(L, -4));
+	lua_getglobal(L, "__script");
+	auto &script = *reinterpret_cast<Script*>(lua_touserdata(L, -1));
+	lua_getglobal(L, "__extension");
+	auto &extension = *reinterpret_cast<function<int(Script &)>*>(lua_touserdata(L, -1));
+	lua_pop(L, 2);
 	return extension(script);
 }
 bool Script::registerExtension(const char *name, std::function<int(Script &)> extension)
@@ -117,9 +120,15 @@
 	else
 		full_name = string("gpick/") + name;
 	lua_pushlightuserdata(L, this);
+	lua_setglobal(L, "__script");
 	lua_pushlightuserdata(L, &extension);
+	lua_setglobal(L, "__extension");
 	luaL_requiref(m_state, full_name.c_str(), registerLuaPackage, 0);
-	lua_pop(L, 3);
+	lua_pushnil(L);
+	lua_setglobal(L, "__script");
+	lua_pushnil(L);
+	lua_setglobal(L, "__extension");
+	lua_pop(L, 1);
 	return true;
 }
 std::string Script::getString(int index)


unnecessary cast

unnecessary cast

Change-Id: Ic5a6dfb58ea2545c8474bff8841c650b3eb2c93f

--- sw/source/core/crsr/viscrs.cxx
+++ sw/source/core/crsr/viscrs.cxx
@@ -611,7 +611,7 @@
         {
             for( nActCnt = aArr[n]; nActCnt--; )
                 pSh->StartAction();
-            pSh = static_cast<SwViewShell*>(pSh->GetNext());
+            pSh = pSh->GetNext();
         }
     }
     else


1.双击交易详情的时候，如果不存在那个dlg返回

1.双击交易详情的时候，如果不存在那个dlg返回

Signed-off-by: bess <776536184@qq.com>

Former-commit-id: fe68fe8432f2e8aa23a5f86a8f1c604d8a848b0c

--- DacrsUI/TxDetailDlg.cpp
+++ DacrsUI/TxDetailDlg.cpp
@@ -254,6 +254,7 @@
 		CString strShowData;
 		strShowData.AppendFormat(_T("%s") ,_T("˽ײ")) ;
 		GetDlgItem(IDC_EDIT_TXDETAIL)->SetWindowText(strShowData);
+		return;
 	}
 	//string txdetail = tx.ToJson();
 	uistruct::REVTRANSACTION_t tx;


+ [indep] improve Overload macro. it can accepts zeo argument.


Turned off debug instrumentation in MprEncode

git-svn-id: f26ccc5efe72c2bd8e1c40f599fe313f2692e4de@11909 a612230a-c5fa-0310-af8b-88eea846685b

--- sipXmediaLib/src/mp/MprEncode.cpp
+++ sipXmediaLib/src/mp/MprEncode.cpp
@@ -53,7 +53,7 @@
 // EXTERNAL FUNCTIONS
 // EXTERNAL VARIABLES
 // CONSTANTS
-#define TEST_PRINT
+//#define TEST_PRINT

 // STATIC VARIABLE INITIALIZATIONS
    // At 10 ms each, 10 seconds.  We will send an RTP packet to each active


Fixed issue 9

Fixed issue 9

--- source/mainWindow.cpp
+++ source/mainWindow.cpp
@@ -40,60 +40,63 @@
 		QSettings cfg(QSettings::IniFormat, QSettings::UserScope, "Mozilla", "Firefox");
 		QString path = QFileInfo(cfg.fileName()).absolutePath()+"/Firefox";
 		QSettings profiles(path+"/profiles.ini", QSettings::IniFormat);
-		int reponse = QMessageBox::question(this, tr("Danbooru Downloader"), tr("L'extension pour Mozilla Firefox \"Danbooru Downloader\" a t dtcte sur votre systme. Souhaitez-vous en importer les prfrences ?"), QMessageBox::Yes | QMessageBox::No);
-		if (reponse == QMessageBox::Yes)
-		{
-			QFile prefs(path+"/"+profiles.value("Profile0/Path").toString()+"/prefs.js");
-			if (prefs.exists())
+		if (QFile::exists(path+"/"+profiles.value("Profile0/Path").toString()+"/extensions/danbooru_downloader@cuberocks.net.xpi"))
+		{
+			int reponse = QMessageBox::question(this, tr("Danbooru Downloader"), tr("L'extension pour Mozilla Firefox \"Danbooru Downloader\" a t dtcte sur votre systme. Souhaitez-vous en importer les prfrences ?"), QMessageBox::Yes | QMessageBox::No);
+			if (reponse == QMessageBox::Yes)
 			{
-				if (prefs.open(QIODevice::ReadOnly | QIODevice::Text))
+				QFile prefs(path+"/"+profiles.value("Profile0/Path").toString()+"/prefs.js");
+				if (prefs.exists())
 				{
-					QString source;
-					while (!prefs.atEnd())
-					{ source += QString(prefs.readLine()); }
-					QRegExp rx("user_pref\\(\"danbooru.downloader.([^\"]+)\", ([^\\)]+)\\);");
-					int pos = 0;
-					QMap<QString,QString> firefox, assoc;
-					assoc["blacklist"] = "blacklistedtags";
-					assoc["generalTagsSeparator"] = "separator";
-					assoc["multipleArtistsAll"] = "artist_useall";
-					assoc["multipleArtistsDefault"] = "artist_value";
-					assoc["multipleArtistsSeparator"] = "artist_sep";
-					assoc["multipleCharactersAll"] = "character_useall";
-					assoc["multipleCharactersDefault"] = "character_value";
-					assoc["multipleCharactersSeparator"] = "character_sep";
-					assoc["multipleCopyrightsAll"] = "copyright_useall";
-					assoc["multipleCopyrightsDefault"] = "copyright_value";
-					assoc["multipleCopyrightsSeparator"] = "copyright_sep";
-					assoc["noArtist"] = "artist_empty";
-					assoc["noCharacter"] = "character_empty";
-					assoc["noCopyright"] = "copyright_empty";
-					assoc["targetFolder"] = "path";
-					assoc["targetName"] = "filename";
-					while ((pos = rx.indexIn(source, pos)) != -1)
+					if (prefs.open(QIODevice::ReadOnly | QIODevice::Text))
 					{
-						pos += rx.matchedLength();
-						QString value = rx.cap(2);
-						if (value.left(1) == "\"")	{ value = value.right(value.length()-1);	}
-						if (value.right(1) == "\"")	{ value = value.left(value.length()-1);		}
-						firefox[rx.cap(1)] = value;
-					}
-					QSettings settings("settings.ini", QSettings::IniFormat);
-					settings.beginGroup("Save");
-					if (firefox.keys().contains("useBlacklist"))
-					{
-						if (firefox["useBlacklist"] == "true")
-						{ settings.setValue("downloadblacklist", false); }
-						else
-						{ settings.setValue("downloadblacklist", true); }
-					}
-					for (int i = 0; i < firefox.size(); i++)
-					{
-						if (assoc.keys().contains(firefox.keys().at(i)))
+						QString source;
+						while (!prefs.atEnd())
+						{ source += QString(prefs.readLine()); }
+						QRegExp rx("user_pref\\(\"danbooru.downloader.([^\"]+)\", ([^\\)]+)\\);");
+						int pos = 0;
+						QMap<QString,QString> firefox, assoc;
+						assoc["blacklist"] = "blacklistedtags";
+						assoc["generalTagsSeparator"] = "separator";
+						assoc["multipleArtistsAll"] = "artist_useall";
+						assoc["multipleArtistsDefault"] = "artist_value";
+						assoc["multipleArtistsSeparator"] = "artist_sep";
+						assoc["multipleCharactersAll"] = "character_useall";
+						assoc["multipleCharactersDefault"] = "character_value";
+						assoc["multipleCharactersSeparator"] = "character_sep";
+						assoc["multipleCopyrightsAll"] = "copyright_useall";
+						assoc["multipleCopyrightsDefault"] = "copyright_value";
+						assoc["multipleCopyrightsSeparator"] = "copyright_sep";
+						assoc["noArtist"] = "artist_empty";
+						assoc["noCharacter"] = "character_empty";
+						assoc["noCopyright"] = "copyright_empty";
+						assoc["targetFolder"] = "path";
+						assoc["targetName"] = "filename";
+						while ((pos = rx.indexIn(source, pos)) != -1)
 						{
-							QString v =  firefox.values().at(i);
-							v.replace("\\\\", "\\");
-							settings.setValue(assoc[firefox.keys().at(i)], v);
+							pos += rx.matchedLength();
+							QString value = rx.cap(2);
+							if (value.left(1) == "\"")	{ value = value.right(value.length()-1);	}
+							if (value.right(1) == "\"")	{ value = value.left(value.length()-1);		}
+							firefox[rx.cap(1)] = value;
+						}
+						QSettings settings("settings.ini", QSettings::IniFormat);
+						settings.beginGroup("Save");
+						if (firefox.keys().contains("useBlacklist"))
+						{
+							if (firefox["useBlacklist"] == "true")
+							{ settings.setValue("downloadblacklist", false); }
+							else
+							{ settings.setValue("downloadblacklist", true); }
+						}
+						for (int i = 0; i < firefox.size(); i++)
+						{
+							if (assoc.keys().contains(firefox.keys().at(i)))
+							{
+								QString v =  firefox.values().at(i);
+								v.replace("\\\\", "\\");
+								settings.setValue(assoc[firefox.keys().at(i)], v);
+							}
 						}
 					}
 				}


INTEGRATION: CWS aw035 (1.36.258); FILE MERGED 2006/07/14 11:02:06 aw 1.36.258.1: #126320# SdrMark::GetObj() -> SdrMark::GetMarkedSdrObj() for isolating selection handling

--- sw/source/core/frmedt/fews.cxx
+++ sw/source/core/frmedt/fews.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: fews.cxx,v $
  *
- *  $Revision: 1.36 $
+ *  $Revision: 1.37 $
  *
- *  last change: $Author: hr $ $Date: 2006-01-27 14:35:04 $
+ *  last change: $Author: rt $ $Date: 2006-07-25 12:34:30 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -596,7 +596,7 @@
                 {
                     for ( USHORT i = 0; i < rMrkList.GetMarkCount(); ++i )
                     {
-                        SdrObject* pDrawObj = rMrkList.GetMark(i)->GetObj();
+                        SdrObject* pDrawObj = rMrkList.GetMark(i)->GetMarkedSdrObj();
                         aDrawObjs.push_back( pDrawObj );
                     }
                 }
@@ -1287,7 +1287,7 @@
         if( rMrkList.GetMarkCount() != 1 )
             return bVert;

-        SdrObject* pObj = rMrkList.GetMark( 0 )->GetObj();
+        SdrObject* pObj = rMrkList.GetMark( 0 )->GetMarkedSdrObj();
         // --> OD 2006-01-06 #123831# - make code robust:
         if ( !pObj )
         {


coverity#1190349 Division or modulo by zero

Change-Id: Ia32e9197d0b5d5a02187d11f05bcf2dcae5ccb76

--- sw/source/core/text/inftxt.cxx
+++ sw/source/core/text/inftxt.cxx
@@ -833,19 +833,13 @@

     // The maximum width depends on the current orientation
     const sal_uInt16 nDir = m_pFnt->GetOrientation( rInf.GetTxtFrm()->IsVertical() );
-    SwTwips nMaxWidth = 0;
-    switch ( nDir )
-    {
-    case 0 :
+    SwTwips nMaxWidth;
+    if (nDir == 900 || nDir == 2700)
+        nMaxWidth = rRect.Height();
+    else
+    {
+        assert(nDir == 0); //Unknown direction set at font
         nMaxWidth = rRect.Width();
-        break;
-    case 900 :
-    case 2700 :
-        nMaxWidth = rRect.Height();
-        break;
-    default:
-        OSL_FAIL( "Unknown direction set at font" );
-        break;
     }

     // check if char fits into rectangle


INTEGRATION: CWS dbgmacros1 (1.12.150); FILE MERGED 2003/04/10 09:01:24 kso 1.12.150.1: #108413# - debug macro unification.

--- sw/source/core/text/itradj.cxx
+++ sw/source/core/text/itradj.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: itradj.cxx,v $
  *
- *  $Revision: 1.12 $
- *
- *  last change: $Author: fme $ $Date: 2002-09-18 07:51:48 $
+ *  $Revision: 1.13 $
+ *
+ *  last change: $Author: vg $ $Date: 2003-04-15 16:53:39 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -67,7 +67,7 @@

 #include "frame.hxx"       // CalcFlyAdjust()
 #include "paratr.hxx"
-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
 # include "ndtxt.hxx"        // pSwpHints, Ausgabeoperator
 #endif

@@ -596,7 +596,7 @@
         default : return;
     }

-#ifdef DEBUG
+#if OSL_DEBUG_LEVEL > 1
 /*
     if( OPTDBG( *pInf ) )
     {


fdo#80721: Use the old way of drawing the pilcrow (but with changed color).

This fixes the reported problem (that the pilcrow stopped showning for
centered paragraphs), and additionally makes the pilcrow large for large
paragraphs (like titles) again.

Change-Id: I78d9986c0da6abfb9936984bb8b72d5eba88c9d7

--- sw/source/core/text/porrst.cxx
+++ sw/source/core/text/porrst.cxx
@@ -59,9 +59,18 @@

 void SwTmpEndPortion::Paint( const SwTxtPaintInfo &rInf ) const
 {
-    if( rInf.OnWin() && rInf.GetOpt().IsParagraph() )
-    {
-        rInf.DrawSpecial( *this, CH_PAR, Color(NON_PRINTING_CHARACTER_COLOR) );
+    if (rInf.OnWin() && rInf.GetOpt().IsParagraph())
+    {
+        const SwFont* pOldFnt = rInf.GetFont();
+
+        SwFont aFont(*pOldFnt);
+        aFont.SetColor(NON_PRINTING_CHARACTER_COLOR);
+        const_cast<SwTxtPaintInfo&>(rInf).SetFont(&aFont);
+
+        // draw the pilcrow
+        rInf.DrawText(OUString(CH_PAR), *this);
+
+        const_cast<SwTxtPaintInfo&>(rInf).SetFont(const_cast<SwFont*>(pOldFnt));
     }
 }


#96678#: Vertical Formatting - Undefined color for red arrow portions

--- sw/source/core/text/porrst.cxx
+++ sw/source/core/text/porrst.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: porrst.cxx,v $
  *
- *  $Revision: 1.19 $
- *
- *  last change: $Author: fme $ $Date: 2002-01-21 08:30:44 $
+ *  $Revision: 1.20 $
+ *
+ *  last change: $Author: fme $ $Date: 2002-01-23 14:11:28 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -364,6 +364,7 @@
         aRect.Pos().X() -= aRect.Width() + 20;
     }

+    Color aCol( COL_LIGHTRED );
     SvxFont::DrawArrow( *pOut, aRect.SVRect(), aSize, aCol, bLeft );
 }
 #endif


tdf#92577 sw rendercontext: paint transparent from controls conditionally

Regression from commit beb4aa21d61f0d66392d596be86fb57b4b167239
(SwViewShell::ImplEndAction: avoid direct paint, 2015-06-29), the
problem was that the lcl_PaintTransparentFormControls() call performs
direct paint, so it should be called only in case we don't do an async
paint via invalidate.

As expected, this call is no longer needed for the original i#107365
bug document in case SwViewShell::Paint() will be called by the main
loop shortly.

Change-Id: Ia27c551ed838d610f972f20abbb4ae9f0e1241b6

--- sw/source/core/view/viewsh.cxx
+++ sw/source/core/view/viewsh.cxx
@@ -407,8 +407,8 @@
                     {
                         InvalidateWindows(aRect.SVRect());
                     }
-
-                    lcl_PaintTransparentFormControls(*this, aRect); // i#107365
+                    else
+                        lcl_PaintTransparentFormControls(*this, aRect); // i#107365
                 }

                 pVout.disposeAndClear();


Fix one of the WatchPortEnforcer unit tests

I saw it fail once in CI and think I know why. It is more likely to
happen on slower machines or machines with fewer cores.

--- proto/tests/test_proto_fe_watch_port_enforcer.cpp
+++ proto/tests/test_proto_fe_watch_port_enforcer.cpp
@@ -294,10 +294,18 @@
       AccessArbitration::WriteAccess access(&access_arbitration, act_prof_1_id);
       action();
   });
+  {
+    std::unique_lock<std::mutex> lock(mutex);
+    cv.wait(lock, [&x] { return x == 1; });
+  }
   EXPECT_OK(watch_port_enforcer.add_member(
       act_prof_1_id, grp_h, mbr_h, watch_1));
   EXPECT_OK(watch_port_enforcer.add_member(
       act_prof_2_id, grp_h, mbr_h, watch_1));
+  // Make sure that thread1 has grabbed WriteAccess before we bring the port
+  // down. Otherwise the WatchPortEnforcer may grab access to act_prof_1 first
+  // and block thread1. The wait_for would then timeout in thread1 and the test
+  // would fail.
   EXPECT_EQ(mock->port_status_set(watch_1, PI_PORT_STATUS_DOWN),
             PI_STATUS_SUCCESS);
   thread1.join();


INTEGRATION: CWS canvas02 (1.3.4); FILE MERGED 2005/10/19 14:41:25 thb 1.3.4.1: #i48939# Moved ValueMap from slideshow; adapted AttributeMap accordingly; added debug trigger code, which initiates a screen dump, after an animation batch has completed

--- slideshow/source/engine/attributemap.cxx
+++ slideshow/source/engine/attributemap.cxx
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: attributemap.cxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.4 $
  *
- *  last change: $Author: rt $ $Date: 2005-09-07 20:23:50 $
+ *  last change: $Author: kz $ $Date: 2005-11-02 14:02:09 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -35,16 +35,17 @@

 // must be first
 #include <canvas/debug.hxx>
-#include <attributemap.hxx>
+#include <canvas/canvastools.hxx>

-#include <tools.hxx>
+#include "attributemap.hxx"
+#include "tools.hxx"

 namespace presentation
 {
     namespace internal
     {
-        typedef ValueMap< AttributeType > AnimateAttributeMap;
+        typedef ::canvas::tools::ValueMap< AttributeType > AnimateAttributeMap;

         AttributeType mapAttributeName( const ::rtl::OUString& rAttrName )
         {


INTEGRATION: CWS swdrawobjapi (1.55.12); FILE MERGED 2004/08/10 09:36:58 od 1.55.12.1: #i28749# - provide new property <ShapePositionInHoriL2R> for the import            component.

--- sw/source/filter/xml/swxml.cxx
+++ sw/source/filter/xml/swxml.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: swxml.cxx,v $
  *
- *  $Revision: 1.56 $
- *
- *  last change: $Author: rt $ $Date: 2004-08-20 08:21:37 $
+ *  $Revision: 1.57 $
+ *
+ *  last change: $Author: rt $ $Date: 2004-08-23 08:14:06 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -554,6 +554,13 @@
         { "StreamName", sizeof("StreamName")-1, 0,
               &::getCppuType( (OUString *)0 ),
               beans::PropertyAttribute::MAYBEVOID, 0 },
+        // --> OD 2004-08-10 #i28749# - Add property, which indicates, if the
+        // shape position attributes are given in horizontal left-to-right layout.
+        // This is the case for the OpenOffice.org file format.
+        { "ShapePositionInHoriL2R", sizeof("ShapePositionInHoriL2R")-1, 0,
+              &::getBooleanCppuType(),
+              beans::PropertyAttribute::MAYBEVOID, 0 },
+        // <--
         { NULL, 0, 0, NULL, 0, 0 }
     };
     uno::Reference< beans::XPropertySet > xInfoSet(
@@ -663,6 +670,14 @@
     rDoc.SetRedlineMode_intern( REDLINE_NONE );

     sal_Bool bOASIS = pStorage->GetVersion() > SOFFICE_FILEFORMAT_60;
+    // --> OD 2004-08-10 #i28749# - set property <ShapePositionInHoriL2R>
+    {
+        const sal_Bool bShapePositionInHoriL2R = !bOASIS;
+        xInfoSet->setPropertyValue(
+                OUString(RTL_CONSTASCII_USTRINGPARAM("ShapePositionInHoriL2R")),
+                makeAny( bShapePositionInHoriL2R ) );
+    }
+    // <--
     sal_uInt32 nWarn = 0;
     sal_uInt32 nWarn2 = 0;
     // read storage streams


INTEGRATION: CWS dialogdiet (1.5.276); FILE MERGED 2003/12/01 09:07:20 mba 1.5.276.1: #i22972#: options moved from offmgr

--- sw/source/ui/chrdlg/pardlg.cxx
+++ sw/source/ui/chrdlg/pardlg.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: pardlg.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: vg $ $Date: 2003-04-17 15:16:22 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: hr $ $Date: 2004-02-03 16:35:38 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -82,12 +82,8 @@
 #ifndef _SFXSTYLE_HXX //autogen
 #include <svtools/style.hxx>
 #endif
-#ifndef _OFA_HTMLCFG_HXX //autogen
-#include <offmgr/htmlcfg.hxx>
-#endif
-#ifndef _OFF_APP_HXX //autogen
-#include <offmgr/app.hxx>
-#endif
+
+#include <svx/htmlcfg.hxx>

 #ifndef _SVSTDARR_STRINGSISORTDTOR
 #define _SVSTDARR_STRINGSISORTDTOR
@@ -151,7 +147,7 @@
     AddTabPage(TP_PARA_STD,  SvxStdParagraphTabPage::Create,SvxStdParagraphTabPage::GetRanges);
     AddTabPage(TP_PARA_ALIGN,  SvxParaAlignTabPage::Create,SvxParaAlignTabPage::GetRanges);

-    OfaHtmlOptions* pHtmlOpt = OFF_APP()->GetHtmlOptions();
+    SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get();
     if (!bDrawParaDlg && (!bHtmlMode || pHtmlOpt->IsPrintLayoutExtension()))
         AddTabPage(TP_PARA_EXT,  SvxExtParagraphTabPage::Create,SvxExtParagraphTabPage::GetRanges);
     else


fix compile error

fix compile error

--- protocols/libwebqq/src/impl/webqq_check_login.hpp
+++ protocols/libwebqq/src/impl/webqq_check_login.hpp
@@ -175,7 +175,7 @@
 				m_webqq->m_verifycode.uin = what[3];
 				std::string vfsession = what[4];
 				if (!vfsession.empty())
-					m_webqq->m_ptvfsession = vfsession;
+					m_webqq->pt_verifysession = vfsession;

 				/* We need get the ptvfsession from the header "Set-Cookie" */
 				if(type == "0")


INTEGRATION: CWS os8 (1.5.146); FILE MERGED 2003/04/03 07:14:01 os 1.5.146.1: #108583# precompiled headers removed

--- sw/source/ui/docvw/edtwin3.cxx
+++ sw/source/ui/docvw/edtwin3.cxx
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: edtwin3.cxx,v $
  *
- *  $Revision: 1.5 $
- *
- *  last change: $Author: os $ $Date: 2002-06-12 08:46:07 $
+ *  $Revision: 1.6 $
+ *
+ *  last change: $Author: vg $ $Date: 2003-04-17 15:23:31 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -59,9 +59,6 @@
  *
  ************************************************************************/

-#ifdef PRECOMPILED
-#include "ui_pch.hxx"
-#endif

 #pragma hdrstop


add cheating refinement for Ma0.7 case of GAMM Channel

--- source/solver/run.cpp
+++ source/solver/run.cpp
@@ -98,58 +98,77 @@
             }
           triangulation.set_boundary (2, *spherical_boundary);

-          if (parameters->manifold_circle == 2
-              &&
+          if (parameters->manifold_circle == 2)
+            {
               // Borrow a parameter. This is not good. And I know its not good. Only this one time.
-              parameters->NACA_cheating_refinement == 1)
-            {
-              for (int n=0; n<1; ++n)
+              if (parameters->NACA_cheating_refinement == 1 ||
+                  parameters->NACA_cheating_refinement == 2)
                 {
+                  for (int n=0; n<1; ++n)
+                    {
+                      for (typename Triangulation<dim>::active_cell_iterator
+                           cell = triangulation.begin_active();
+                           cell != triangulation.end();
+                           ++cell)
+                        {
+                          // Refine a elliptic region twice
+                          const double center_x=0.0;
+                          const double center_y=0.0;
+                          const double half_axi_long  = 0.75;
+                          const double half_axi_short = 0.5;
+                          const double a = (cell->center()[0] - center_x)/half_axi_long;
+                          const double b = (cell->center()[1] - center_y)/half_axi_short;
+                          if ((a*a+b*b) < 1.0)
+                            {
+                              cell->set_refine_flag();
+                            }
+                          // And the downstream floor region
+                          if (cell->center()[0] > 0.5 &&
+                              cell->center()[0] < 1.2 &&
+                              cell->center()[1] < 0.2)
+                            {
+                              cell->set_refine_flag();
+                            }
+                          // And the shock region
+                          if (parameters->NACA_cheating_refinement == 2)
+                            if (cell->center()[0] > 0.25 &&
+                                cell->center()[0] < 0.50 &&
+                                cell->center()[1] < 1.0)
+                              {
+                                cell->set_refine_flag();
+                              }
+                        }
+                      triangulation.execute_coarsening_and_refinement();
+                    }
+
                   for (typename Triangulation<dim>::active_cell_iterator
                        cell = triangulation.begin_active();
                        cell != triangulation.end();
                        ++cell)
                     {
-                      // Refine a elliptic region twice
-                      const double center_x=0.0;
-                      const double center_y=0.0;
-                      const double half_axi_long  = 0.75;
-                      const double half_axi_short = 0.5;
-                      const double a = (cell->center()[0] - center_x)/half_axi_long;
-                      const double b = (cell->center()[1] - center_y)/half_axi_short;
-                      if ((a*a+b*b) < 1.0)
+                      // refine the two stagnation points once more
+                      Point<dim> front;
+                      front[0] = -0.5;
+                      Point<dim> rear;
+                      rear[0] = 0.5;
+                      if (front.distance (cell->center()) < 0.2
+                          ||
+                          rear.distance (cell->center()) < 0.2)
                         {
                           cell->set_refine_flag();
                         }
-                      // And the downstream floor region
-                      if (cell->center()[0] > 0.5 &&
-                          cell->center()[0] < 1.2 &&
-                          cell->center()[1] < 0.2)
-                        {
-                          cell->set_refine_flag();
-                        }
+                      // And the shock region
+                      if (parameters->NACA_cheating_refinement == 2)
+                        if (cell->center()[0] > 0.30 &&
+                            cell->center()[0] < 0.45 &&
+                            cell->center()[1] < 1.0)
+                          {
+                            cell->set_refine_flag();
+                          }
                     }
                   triangulation.execute_coarsening_and_refinement();
                 }
-              // refine the two stagnation points once more
-              for (typename Triangulation<dim>::active_cell_iterator
-                   cell = triangulation.begin_active();
-                   cell != triangulation.end();
-                   ++cell)
-                {
-                  Point<dim> front;
-                  front[0] = -0.5;
-                  Point<dim> rear;
-                  rear[0] = 0.5;
-                  if (front.distance (cell->center()) < 0.2
-                      ||
-                      rear.distance (cell->center()) < 0.2)
-                    {
-                      cell->set_refine_flag();
-                    }
-                }
-              triangulation.execute_coarsening_and_refinement();
-            } // End if (parameters->manifold_circle == 2 /* && cheating refinement == true*/)
+            } // End if (parameters->manifold_circle == 2)
         }
       if (parameters->NACA_foil > 0)
         {


commit depends on local rcs

commit depends on local rcs

git-svn-id: e171abefef93db0a74257c7d87d5b6400fe00c1f@13 f22100f3-aa73-48fe-a4fb-fd497bb32605

--- syncedit/trunk/src/support.cpp
+++ syncedit/trunk/src/support.cpp
@@ -86,6 +86,10 @@
   menuEdit->AppendSeparator();
   menuEdit->Append(ID_EDIT_CONTROL_CHAR, exEllipsed(_("&Control Char"), "Ctrl+H"));
   menuEdit->AppendSeparator();
+#ifndef LOCAL_RCS
+  menuEdit->Append(ID_COMMIT, _(C&ommit"));
+  menuEdit->AppendSeparator();
+#endif
   menuEdit->Append(ID_EDIT_MACRO_START_RECORD, _("Start Record"));
   menuEdit->Append(ID_EDIT_MACRO_STOP_RECORD, _("Stop Record"));
   menuEdit->Append(ID_EDIT_MACRO_PLAYBACK, _("Playback\tCtrl+M"));


specialization getValue<unsigned long long> we have to use get_string to get a string value from CDB and than cast it. This should fix: COMP-4268

git-svn-id: afcf11d89342f630bd950d18a70234a9e277d909@131130 523d945c-050c-4681-91ec-863ad3bb968a

--- LGPL/CommonSoftware/cdb/ws/src/cdbDAONode.cpp
+++ LGPL/CommonSoftware/cdb/ws/src/cdbDAONode.cpp
@@ -18,7 +18,7 @@
  *    License along with this library; if not, write to the Free Software
  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA
  *
- * "@(#) $Id: cdbDAONode.cpp,v 1.9 2010/04/20 14:46:51 bjeram Exp $"
+ * "@(#) $Id: cdbDAONode.cpp,v 1.10 2010/05/07 09:08:05 bjeram Exp $"
  *
  * who       when        what
  * --------  ----------  ----------------------------------------------
@@ -431,7 +431,7 @@
 template<>
 long long DAONode::getValue(const char * propertyName)
 {
-	// until get_long is fixed that it can read also xs:long which is 64 bit we have to read string and cast it to long  ong
+	// until get_long is fixed that it can read also xs:long which is 64 bit we have to read string and cast it to long long
 	long long var;
 	CORBA::String_var str = this->get_string( propertyName );
 	std::istringstream is(str.in());
@@ -458,7 +458,20 @@
 template<>
 unsigned long long  DAONode::getValue(const char * propertyName)
 {
-	return static_cast<unsigned long long>(get_long( propertyName ));
+	// we can not use get_long to read xs:unisngedLong which is 64 bit we have to read string and cast it to unsigned long long
+	// see: COMP-4268
+		unsigned long long var;
+		CORBA::String_var str = this->get_string( propertyName );
+		std::istringstream is(str.in());
+		(istream&) is >> var ;
+			if (!is)
+			{
+				ACS_LOG(LM_RUNTIME_CONTEXT, "DAONode::getValue<unsigned long long>",
+							  (LM_ERROR, "Problem converting string value: %s to unsigned long long!", str.in()));
+				 throw cdbErrType::WrongCDBDataTypeEx();
+			}//if
+
+			return var;
 }

 template<>


fixing missed timer init

fixing missed timer init

--- clients/rider/rider.cpp
+++ clients/rider/rider.cpp
@@ -487,6 +487,8 @@
 		hipEvent_t start, stop;
 		HIP_V_THROW( hipEventCreate(&start), "hipEventCreate failed" );
 		HIP_V_THROW( hipEventCreate(&stop), "hipEventCreate failed" );
+
+		HIP_V_THROW( hipEventRecord(start), "hipEventRecord failed" );

 		for( unsigned i = 0; i < profile_count; ++i )
 		{


changed logic order so all failure cases drop back to 0,0,1 normal

git-svn-id: 767549f2a3626ae39d79f5348867a3ebb5082aca@4123 c7283977-0100-402a-a91a-fa70b306dbfe

--- software/control/src/QPControllermex.cpp
+++ software/control/src/QPControllermex.cpp
@@ -127,14 +127,14 @@
       auto view = state->getView();
       if (view != NULL) {
         if (view->getClosest(contact_pos.cast<float>(),floatPos,floatNormal)) {
+          pos = floatPos.cast<double>();
+          normal = floatNormal.cast<double>();
           return;
         }
-        pos = floatPos.cast<double>();
-        normal = floatNormal.cast<double>();
       }
     }
-    mexErrMsgTxt("What to do if there is no data?");
   } else {
+    mexPrintf("Warning: using 0,0,1 as normal");
     pos << contact_pos.topRows(2), 0;
     normal << 0,0,1;
   }


compile, sorry

compile, sorry

--- part/view/kateview.cpp
+++ part/view/kateview.cpp
@@ -1729,7 +1729,7 @@

 int KateView::virtualCursorColumn() const
 {
-  return = m_doc->toVirtualColumn(m_viewInternal->getCursor());
+  return m_doc->toVirtualColumn(m_viewInternal->getCursor());
 }

 void KateView::notifyMousePositionChanged(const KTextEditor::Cursor& newPosition)


Fixed depth navdata output label

Fixed depth navdata output label

--- sketches/Trident/NDataManager.cpp
+++ sketches/Trident/NDataManager.cpp
@@ -30,7 +30,7 @@
 		Serial.print( F( "hdgd:" ) );
 		Serial.print( m_navData.HDGD );
 		Serial.print( ';' );
-		Serial.print( F( "deap:" ) );
+		Serial.print( F( "deep:" ) );
 		Serial.print( m_navData.DEEP );
 		Serial.print( ';' );
 		Serial.print( F( "pitc:" ) );


Hopefully got rid of the extra characters in the logging when using streams

--- sm_logging/src/LoggingGlobals.cpp
+++ sm_logging/src/LoggingGlobals.cpp
@@ -210,7 +210,9 @@

             std::vector<char> str;
             ss.swap_vector(str);
-
+            // make sure the string is null terminated.
+            str.push_back('\0');
+
             boost::mutex::scoped_lock lock(_print_mutex);

             _printing_thread_id = boost::this_thread::get_id();


add comments for bug #39

add comments for bug #39

--- trunk/src/app/srs_app_rtmp_conn.cpp
+++ trunk/src/app/srs_app_rtmp_conn.cpp
@@ -231,6 +231,8 @@
         // for "some" system control error,
         // logical accept and retry stream service.
         if (ret == ERROR_CONTROL_RTMP_CLOSE) {
+            // TODO: FIXME: use ping message to anti-death of socket.
+            // @see: https://github.com/winlinvip/simple-rtmp-server/issues/39
             // set timeout to a larger value, for user paused.
             rtmp->set_recv_timeout(SRS_PAUSED_RECV_TIMEOUT_US);
             rtmp->set_send_timeout(SRS_PAUSED_SEND_TIMEOUT_US);


Simplify code, NFC.

Simplify code, NFC.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@238750 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
@@ -65,181 +65,134 @@
                                            const MCFixup &Fixup,
                                            bool IsPCRel) const {
   // determine the type of the relocation
-  unsigned Type = (unsigned)ELF::R_MIPS_NONE;
   unsigned Kind = (unsigned)Fixup.getKind();

   switch (Kind) {
-  default:
-    llvm_unreachable("invalid fixup kind!");
   case Mips::fixup_Mips_32:
   case FK_Data_4:
-    Type = ELF::R_MIPS_32;
-    break;
+    return ELF::R_MIPS_32;
   case Mips::fixup_Mips_64:
   case FK_Data_8:
-    Type = ELF::R_MIPS_64;
-    break;
+    return ELF::R_MIPS_64;
   case FK_GPRel_4:
     if (isN64()) {
+      unsigned Type = (unsigned)ELF::R_MIPS_NONE;
       Type = setRType((unsigned)ELF::R_MIPS_GPREL32, Type);
       Type = setRType2((unsigned)ELF::R_MIPS_64, Type);
       Type = setRType3((unsigned)ELF::R_MIPS_NONE, Type);
+      return Type;
     }
-    else
-      Type = ELF::R_MIPS_GPREL32;
-    break;
+    return ELF::R_MIPS_GPREL32;
   case Mips::fixup_Mips_GPREL16:
-    Type = ELF::R_MIPS_GPREL16;
-    break;
+    return ELF::R_MIPS_GPREL16;
   case Mips::fixup_Mips_26:
-    Type = ELF::R_MIPS_26;
-    break;
+    return ELF::R_MIPS_26;
   case Mips::fixup_Mips_CALL16:
-    Type = ELF::R_MIPS_CALL16;
-    break;
+    return ELF::R_MIPS_CALL16;
   case Mips::fixup_Mips_GOT_Global:
   case Mips::fixup_Mips_GOT_Local:
-    Type = ELF::R_MIPS_GOT16;
-    break;
+    return ELF::R_MIPS_GOT16;
   case Mips::fixup_Mips_HI16:
-    Type = ELF::R_MIPS_HI16;
-    break;
+    return ELF::R_MIPS_HI16;
   case Mips::fixup_Mips_LO16:
-    Type = ELF::R_MIPS_LO16;
-    break;
+    return ELF::R_MIPS_LO16;
   case Mips::fixup_Mips_TLSGD:
-    Type = ELF::R_MIPS_TLS_GD;
-    break;
+    return ELF::R_MIPS_TLS_GD;
   case Mips::fixup_Mips_GOTTPREL:
-    Type = ELF::R_MIPS_TLS_GOTTPREL;
-    break;
+    return ELF::R_MIPS_TLS_GOTTPREL;
   case Mips::fixup_Mips_TPREL_HI:
-    Type = ELF::R_MIPS_TLS_TPREL_HI16;
-    break;
+    return ELF::R_MIPS_TLS_TPREL_HI16;
   case Mips::fixup_Mips_TPREL_LO:
-    Type = ELF::R_MIPS_TLS_TPREL_LO16;
-    break;
+    return ELF::R_MIPS_TLS_TPREL_LO16;
   case Mips::fixup_Mips_TLSLDM:
-    Type = ELF::R_MIPS_TLS_LDM;
-    break;
+    return ELF::R_MIPS_TLS_LDM;
   case Mips::fixup_Mips_DTPREL_HI:
-    Type = ELF::R_MIPS_TLS_DTPREL_HI16;
-    break;
+    return ELF::R_MIPS_TLS_DTPREL_HI16;
   case Mips::fixup_Mips_DTPREL_LO:
-    Type = ELF::R_MIPS_TLS_DTPREL_LO16;
-    break;
+    return ELF::R_MIPS_TLS_DTPREL_LO16;
   case Mips::fixup_Mips_Branch_PCRel:
   case Mips::fixup_Mips_PC16:
-    Type = ELF::R_MIPS_PC16;
-    break;
+    return ELF::R_MIPS_PC16;
   case Mips::fixup_Mips_GOT_PAGE:
-    Type = ELF::R_MIPS_GOT_PAGE;
-    break;
+    return ELF::R_MIPS_GOT_PAGE;
   case Mips::fixup_Mips_GOT_OFST:
-    Type = ELF::R_MIPS_GOT_OFST;
-    break;
+    return ELF::R_MIPS_GOT_OFST;
   case Mips::fixup_Mips_GOT_DISP:
-    Type = ELF::R_MIPS_GOT_DISP;
-    break;
-  case Mips::fixup_Mips_GPOFF_HI:
+    return ELF::R_MIPS_GOT_DISP;
+  case Mips::fixup_Mips_GPOFF_HI: {
+    unsigned Type = (unsigned)ELF::R_MIPS_NONE;
     Type = setRType((unsigned)ELF::R_MIPS_GPREL16, Type);
     Type = setRType2((unsigned)ELF::R_MIPS_SUB, Type);
     Type = setRType3((unsigned)ELF::R_MIPS_HI16, Type);
-    break;
-  case Mips::fixup_Mips_GPOFF_LO:
+    return Type;
+  }
+  case Mips::fixup_Mips_GPOFF_LO: {
+    unsigned Type = (unsigned)ELF::R_MIPS_NONE;
     Type = setRType((unsigned)ELF::R_MIPS_GPREL16, Type);
     Type = setRType2((unsigned)ELF::R_MIPS_SUB, Type);
     Type = setRType3((unsigned)ELF::R_MIPS_LO16, Type);
-    break;
+    return Type;
+  }
   case Mips::fixup_Mips_HIGHER:
-    Type = ELF::R_MIPS_HIGHER;
-    break;
+    return ELF::R_MIPS_HIGHER;
   case Mips::fixup_Mips_HIGHEST:
-    Type = ELF::R_MIPS_HIGHEST;
-    break;
+    return ELF::R_MIPS_HIGHEST;
   case Mips::fixup_Mips_GOT_HI16:
-    Type = ELF::R_MIPS_GOT_HI16;
-    break;
+    return ELF::R_MIPS_GOT_HI16;
   case Mips::fixup_Mips_GOT_LO16:
-    Type = ELF::R_MIPS_GOT_LO16;
-    break;
+    return ELF::R_MIPS_GOT_LO16;
   case Mips::fixup_Mips_CALL_HI16:
-    Type = ELF::R_MIPS_CALL_HI16;
-    break;
+    return ELF::R_MIPS_CALL_HI16;
   case Mips::fixup_Mips_CALL_LO16:
-    Type = ELF::R_MIPS_CALL_LO16;
-    break;
+    return ELF::R_MIPS_CALL_LO16;
   case Mips::fixup_MICROMIPS_26_S1:
-    Type = ELF::R_MICROMIPS_26_S1;
-    break;
+    return ELF::R_MICROMIPS_26_S1;
   case Mips::fixup_MICROMIPS_HI16:
-    Type = ELF::R_MICROMIPS_HI16;
-    break;
+    return ELF::R_MICROMIPS_HI16;
   case Mips::fixup_MICROMIPS_LO16:
-    Type = ELF::R_MICROMIPS_LO16;
-    break;
+    return ELF::R_MICROMIPS_LO16;
   case Mips::fixup_MICROMIPS_GOT16:
-    Type = ELF::R_MICROMIPS_GOT16;
-    break;
+    return ELF::R_MICROMIPS_GOT16;
   case Mips::fixup_MICROMIPS_PC7_S1:
-    Type = ELF::R_MICROMIPS_PC7_S1;
-    break;
+    return ELF::R_MICROMIPS_PC7_S1;
   case Mips::fixup_MICROMIPS_PC10_S1:
-    Type = ELF::R_MICROMIPS_PC10_S1;
-    break;
+    return ELF::R_MICROMIPS_PC10_S1;
   case Mips::fixup_MICROMIPS_PC16_S1:
-    Type = ELF::R_MICROMIPS_PC16_S1;
-    break;
+    return ELF::R_MICROMIPS_PC16_S1;
   case Mips::fixup_MICROMIPS_CALL16:
-    Type = ELF::R_MICROMIPS_CALL16;
-    break;
+    return ELF::R_MICROMIPS_CALL16;
   case Mips::fixup_MICROMIPS_GOT_DISP:
-    Type = ELF::R_MICROMIPS_GOT_DISP;
-    break;
+    return ELF::R_MICROMIPS_GOT_DISP;
   case Mips::fixup_MICROMIPS_GOT_PAGE:
-    Type = ELF::R_MICROMIPS_GOT_PAGE;
-    break;
+    return ELF::R_MICROMIPS_GOT_PAGE;
   case Mips::fixup_MICROMIPS_GOT_OFST:
-    Type = ELF::R_MICROMIPS_GOT_OFST;
-    break;
+    return ELF::R_MICROMIPS_GOT_OFST;
   case Mips::fixup_MICROMIPS_TLS_GD:
-    Type = ELF::R_MICROMIPS_TLS_GD;
-    break;
+    return ELF::R_MICROMIPS_TLS_GD;
   case Mips::fixup_MICROMIPS_TLS_LDM:
-    Type = ELF::R_MICROMIPS_TLS_LDM;
-    break;
+    return ELF::R_MICROMIPS_TLS_LDM;
   case Mips::fixup_MICROMIPS_TLS_DTPREL_HI16:
-    Type = ELF::R_MICROMIPS_TLS_DTPREL_HI16;
-    break;
+    return ELF::R_MICROMIPS_TLS_DTPREL_HI16;
   case Mips::fixup_MICROMIPS_TLS_DTPREL_LO16:
-    Type = ELF::R_MICROMIPS_TLS_DTPREL_LO16;
-    break;
+    return ELF::R_MICROMIPS_TLS_DTPREL_LO16;
   case Mips::fixup_MICROMIPS_TLS_TPREL_HI16:
-    Type = ELF::R_MICROMIPS_TLS_TPREL_HI16;
-    break;
+    return ELF::R_MICROMIPS_TLS_TPREL_HI16;
   case Mips::fixup_MICROMIPS_TLS_TPREL_LO16:
-    Type = ELF::R_MICROMIPS_TLS_TPREL_LO16;
-    break;
+    return ELF::R_MICROMIPS_TLS_TPREL_LO16;
   case Mips::fixup_MIPS_PC19_S2:
-    Type = ELF::R_MIPS_PC19_S2;
-    break;
+    return ELF::R_MIPS_PC19_S2;
   case Mips::fixup_MIPS_PC18_S3:
-    Type = ELF::R_MIPS_PC18_S3;
-    break;
+    return ELF::R_MIPS_PC18_S3;
   case Mips::fixup_MIPS_PC21_S2:
-    Type = ELF::R_MIPS_PC21_S2;
-    break;
+    return ELF::R_MIPS_PC21_S2;
   case Mips::fixup_MIPS_PC26_S2:
-    Type = ELF::R_MIPS_PC26_S2;
-    break;
+    return ELF::R_MIPS_PC26_S2;
   case Mips::fixup_MIPS_PCHI16:
-    Type = ELF::R_MIPS_PCHI16;
-    break;
+    return ELF::R_MIPS_PCHI16;
   case Mips::fixup_MIPS_PCLO16:
-    Type = ELF::R_MIPS_PCLO16;
-    break;
+    return ELF::R_MIPS_PCLO16;
   }
-  return Type;
+  llvm_unreachable("invalid fixup kind!");
 }

 // Sort entries by SortOffset in descending order.


[mips] Try to fix 'truncation from FindBestPredicateResult to bool' reported by MSVC

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@268928 91177308-0d34-0410-b5e6-96231b3b80d8

--- lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
+++ lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp
@@ -167,9 +167,9 @@
 /// A matching relocation is unbeatable if:
 /// - It is not already involved in a match.
 /// - It's offset is exactly that of the one given in R.
-static bool isMatchingReloc(const MipsRelocationEntry &X,
-                            const ELFRelocationEntry &R,
-                            unsigned MatchingType) {
+static FindBestPredicateResult isMatchingReloc(const MipsRelocationEntry &X,
+                                               const ELFRelocationEntry &R,
+                                               unsigned MatchingType) {
   if (X.R.Type == MatchingType && X.R.OriginalSymbol == R.OriginalSymbol) {
     if (!X.Matched &&
         X.R.OriginalAddend == R.OriginalAddend)